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

Function test_dep_failed

tests/pyapi/test_dependencies.py:23–44  ·  view source on GitHub ↗

Check that consumers of a failed tasks are aborted

(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

21
22
23def test_dep_failed(hq_env: HqEnv):
24 """
25 Check that consumers of a failed tasks are aborted
26 """
27
28 (job, client) = prepare_job_client(hq_env, with_worker=True)
29
30 t1 = job.program(args=bash("exit 1"))
31 t2 = job.program(args=bash("echo 'hello' > foo1.txt"), deps=[t1])
32 job.program(args=bash("echo 'hello' > foo2.txt"), deps=[t2])
33 job.program(args=bash("exit 0"))
34 submitted_job = client.submit(job)
35 time.sleep(0.5)
36 table = hq_env.command(["task", "list", "1"], as_table=True)
37 print(table)
38 wait_for_job_state(hq_env, submitted_job.id, "FAILED")
39
40 table = hq_env.command(["task", "list", "1"], as_table=True)
41 assert table.get_row_value("0") == "FAILED"
42 assert table.get_row_value("1") == "ABORTED"
43 assert table.get_row_value("2") == "ABORTED"
44 assert table.get_row_value("3") == "FINISHED"
45
46
47def test_kill_worker_with_deps(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 8

prepare_job_clientFunction · 0.85
bashFunction · 0.85
wait_for_job_stateFunction · 0.85
programMethod · 0.80
sleepMethod · 0.80
commandMethod · 0.80
get_row_valueMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected