MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / test_server_lost_stop_with_task

Function test_server_lost_stop_with_task

tests/test_worker.py:271–279  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

269
270
271def test_server_lost_stop_with_task(hq_env: HqEnv):
272 hq_env.start_server()
273 worker = hq_env.start_worker(on_server_lost="stop")
274 path = os.path.join(hq_env.work_path, "finished")
275 hq_env.command(["submit", "--array=1-10", "--", "bash", "-c", f"sleep 3; touch {path}"])
276 wait_for_job_state(hq_env, 1, "RUNNING")
277 hq_env.kill_server()
278 hq_env.check_process_exited(worker, expected_code=1)
279 assert not os.path.isfile(path)
280
281
282def test_server_lost_finish_running_with_task(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 6

wait_for_job_stateFunction · 0.85
commandMethod · 0.80
kill_serverMethod · 0.80
check_process_exitedMethod · 0.80
start_serverMethod · 0.45
start_workerMethod · 0.45

Tested by

no test coverage detected