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

Function test_resources_task

tests/pyapi/test_job.py:248–259  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

246
247
248def test_resources_task(hq_env: HqEnv):
249 (job, client) = prepare_job_client(hq_env)
250
251 job.program(
252 args=bash("echo Hello"),
253 resources=ResourceRequest(cpus="2", resources={"res0": 1, "res1": 105.1}),
254 )
255 submitted_job = client.submit(job)
256 wait_for_job_state(hq_env, 1, "WAITING")
257
258 table = hq_env.command(["task", "info", str(submitted_job.id), "0"], as_table=True)
259 table.check_row_value("Resources", "cpus: 2 compact\nres0: 1 compact\nres1: 105.1 compact")
260
261
262def test_priority_task(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 8

ResourceRequestClass · 0.90
prepare_job_clientFunction · 0.85
bashFunction · 0.85
wait_for_job_stateFunction · 0.85
programMethod · 0.80
commandMethod · 0.80
check_row_valueMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected