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

Function test_job_array_error_all

tests/test_array.py:118–144  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

116
117
118def test_job_array_error_all(hq_env: HqEnv):
119 hq_env.start_server()
120 hq_env.command(["submit", "--array=0-9", "--", "/non-existent"])
121 hq_env.start_worker(cpus=2)
122
123 wait_for_job_state(hq_env, 1, "FAILED")
124
125 table = list_jobs(hq_env)
126 table.check_column_value("State", 0, "FAILED")
127
128 table = hq_env.command(["job", "info", "1"], as_table=True)
129 states = table[0].get_row_value("State").split("\n")
130 assert "FAILED (10)" in states
131
132 errors = table[1].as_horizontal().get_column_value("Error")
133 for error in errors:
134 assert "No such file or directory" in error
135
136 table = hq_env.command(["job", "info", "1"], as_table=True)
137 states = table[0].get_row_value("State").split("\n")
138 assert "FAILED (10)" in states
139
140 task_table = hq_env.command(["task", "list", "1", "-v"], as_table=True)
141 for i in range(10):
142 assert task_table.get_column_value("Task ID")[i] == str(i)
143 assert task_table.get_column_value("State")[i] == "FAILED"
144 assert "No such file or directory" in task_table.get_column_value("Error")[i]
145
146
147def test_job_array_cancel(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 10

wait_for_job_stateFunction · 0.85
list_jobsFunction · 0.85
commandMethod · 0.80
check_column_valueMethod · 0.80
get_row_valueMethod · 0.80
get_column_valueMethod · 0.80
as_horizontalMethod · 0.80
start_serverMethod · 0.45
start_workerMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected