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

Function test_task_resource_fractions_scatter

tests/test_resources.py:163–182  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

161
162
163def test_task_resource_fractions_scatter(hq_env: HqEnv):
164 hq_env.start_server()
165 hq_env.start_worker(cpus=4, args=["--resource", "foo=[[a,b,c],[i, j, k],[x, y],[v, w]]"])
166
167 hq_env.command(
168 [
169 "submit",
170 "--resource",
171 "foo=3.5",
172 "--",
173 "bash",
174 "-c",
175 "echo $HQ_RESOURCE_VALUES_foo",
176 ]
177 )
178 wait_for_job_state(hq_env, 1, "FINISHED")
179 with open(default_task_output()) as f:
180 r = f.readline().rstrip().split(",")
181 assert len(r) == 4
182 assert len(set(r)) == 4
183
184
185def test_task_resource_fractions_sum2(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 6

wait_for_job_stateFunction · 0.85
default_task_outputFunction · 0.85
commandMethod · 0.80
start_serverMethod · 0.45
start_workerMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected