def test_jobmanager_read_old_stat():
    global PORT
    PORT += 1
    n = 100
    p_server = mp.Process(target=start_server, args=(n,))
    p_server.start()
    
    time.sleep(1)
     
    p_client = mp.Process(target=start_client)
    p_client.start()
    
    time.sleep(3)
    
    
    # terminate server ... to start again using reload_from_dump
    p_server.terminate()
     
    p_client.join(10)
    p_server.join(10)
 
    assert not p_client.is_alive(), "the client did not terminate on time!"
    assert not p_server.is_alive(), "the server did not terminate on time!"
    print("[+] client and server terminated")
    
    time.sleep(2)
    PORT += 1
    # start server using old dump
    p_server = mp.Process(target=start_server, args=(n,True))
    p_server.start()
    
    time.sleep(2)
     
    p_client = mp.Process(target=start_client)
    p_client.start()

    p_client.join(30)
    p_server.join(30)
 
    assert not p_client.is_alive(), "the client did not terminate on time!"
    assert not p_server.is_alive(), "the server did not terminate on time!"
    print("[+] client and server terminated")    
     
    fname = 'jobmanager.dump'
    with open(fname, 'rb') as f:
        data = jobmanager.JobManager_Server.static_load(f)
    
    final_res_args_set = {a[0] for a in data['final_result']}
         
    set_ref = set(range(1,n))
     
    intersect = set_ref - final_res_args_set
    print(intersect)
     
    assert len(intersect) == 0, "final result does not contain all arguments!"
    print("[+] all arguments found in final_results")    

# def test_hashedViewOnNumpyArray():
#     s = set()
#     
#     a = np.ones(4)
#     ah = jobmanager.hashableCopyOfNumpyArray(a)
#     
#     s.add(ah)
#     
#     b = np.ones(4, dtype=np.int32)
#     bh = jobmanager.hashableCopyOfNumpyArray(b)
# 
#     # hash function independent of dtype    
#     assert hash(ah) == hash(bh)
#     # overwritten equal operator ...
#     assert ah == bh
#     # ... makes such statements possible!
#     assert bh in s
#      
#     # check if it is truly a copy, not just a view
#     b[0] = 2
#     assert bh[0] == 1
#     
#     c = np.ones(5)
#     ch = jobmanager.hashableCopyOfNumpyArray(c)
#     # different array
#     assert not ch in s
#     
#     # check if shape is included in hash calculation
#     bh2 = bh.reshape((2,2))
#     assert bh2 not in s
#     
#     # just some redundant back conversion an checking  
#     bh2 = bh2.reshape((4,))
#     assert bh2 in s
start server, start client, start process trivial jobs,
dataset/ETHPy150Open cimatosa/jobmanager/tests/test_jobmanager.py/test_jobmanager_read_old_stat