def test_shutdown_server_while_client_running():
    global PORT
    PORT += 1
    
    n = 1000
    
    p_server = mp.Process(target=start_server, args=(n,))
    p_server.start()
    
    time.sleep(1)
    
    PORT += 1
    p_client = mp.Process(target=start_client, args=(2,))
    p_client.start()
    
    time.sleep(2)
    
    os.kill(p_server.pid, signal.SIGTERM)
    
    p_server.join(200)
    p_client.join(200)
    
    try:
        assert not p_server.is_alive()
    except:
        p_server.terminate()
        raise
    
    try:
        assert not p_client.is_alive()
    except:
        p_client.terminate()
        raise
        
    
    
    fname = 'jobmanager.dump'
    with open(fname, 'rb') as f:
        data = jobmanager.JobManager_Server.static_load(f)    

    args_set = set(data['args_dict'].keys())
    final_result = data['final_result']

    final_res_args = {a[0] for a in final_result}
        
    args_ref = range(1,n)
    set_ref = set()
    for a in args_ref:
        set_ref.add(binfootprint.dump(a))    
    
    set_recover = set(args_set) | set(final_res_args)
    
    intersec_set = set_ref-set_recover

    if len(intersec_set) == 0:
        print("[+] no arguments lost!")

    assert len(intersec_set) == 0, "NOT all arguments found in dump!"
start server with 1000 elements in queue
dataset/ETHPy150Open cimatosa/jobmanager/tests/test_jobmanager.py/test_shutdown_server_while_client_running