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

Function test_function_resources

tests/pyapi/test_function.py:62–72  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

60
61
62def test_function_resources(hq_env: HqEnv):
63 (job, client) = prepare_job_client(hq_env)
64
65 job.function(lambda: 1, resources=ResourceRequest(cpus="1"))
66 job.function(lambda: 1, resources=ResourceRequest(cpus="2"))
67 job.function(lambda: 1, resources=ResourceRequest(cpus="all"))
68 submitted_job = client.submit(job)
69 time.sleep(2.0)
70
71 table = hq_env.command(["task", "list", str(submitted_job.id)], as_table=True)
72 assert table.get_column_value("State") == ["FINISHED", "WAITING", "FINISHED"]
73
74
75def test_default_workdir(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 7

ResourceRequestClass · 0.90
prepare_job_clientFunction · 0.85
functionMethod · 0.80
sleepMethod · 0.80
commandMethod · 0.80
get_column_valueMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected