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

Function test_task_resources_allocate_string

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

Source from the content-addressed store, hash-verified

271
272
273def test_task_resources_allocate_string(hq_env: HqEnv):
274 hq_env.start_server()
275 hq_env.start_worker(args=["--resource", "foo=[a,b,c]"])
276
277 hq_env.command(
278 [
279 "submit",
280 "--array=1-4",
281 "--resource",
282 "foo=2",
283 "--",
284 "bash",
285 "-c",
286 "echo $HQ_RESOURCE_VALUES_foo",
287 ]
288 )
289 wait_for_job_state(hq_env, 1, "FINISHED")
290
291 for task_id in range(1, 5):
292 with open(default_task_output(task_id=task_id)) as f:
293 indices = set(f.read().rstrip().split(","))
294 assert len(indices) == 2
295 assert indices.issubset(("a", "b", "c"))
296
297
298def test_worker_resource_hwdetect_mem(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