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

Function test_stream_collision

tests/test_stream.py:10–32  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

8
9
10def test_stream_collision(hq_env: HqEnv):
11 os.mkdir("mylog")
12 for i in range(2):
13 print(f"Run {i}")
14 hq_env.start_server()
15 hq_env.command(
16 [
17 "submit",
18 "--stream",
19 "mylog",
20 "--array=1-20",
21 "--",
22 "bash",
23 "-c",
24 "echo Hello from ${HQ_TASK_ID}",
25 ]
26 )
27 hq_env.start_workers(2, cpus="2")
28 wait_for_job_state(hq_env, 1, "FINISHED")
29 hq_env.stop_server()
30 time.sleep(1)
31
32 print(hq_env.command(["output-log", "mylog", "show"], expect_fail="Found streams from multiple server instances"))
33
34
35def test_stream_submit(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 6

wait_for_job_stateFunction · 0.85
commandMethod · 0.80
sleepMethod · 0.80
start_serverMethod · 0.45
start_workersMethod · 0.45
stop_serverMethod · 0.45

Tested by

no test coverage detected