adds utility function wait_worker_server()
uses wait_worker_server for master
adds timeout test, works well