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

Function test_tight_vs_compact_policy

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

Source from the content-addressed store, hash-verified

570
571
572def test_tight_vs_compact_policy(hq_env: HqEnv):
573 hq_env.start_server()
574 hq_env.command(["submit", "--cpus", "6 tight", "--", "bash", "-c", "echo $HQ_CPUS"])
575 hq_env.command(["submit", "--cpus", "6 tight!", "--", "bash", "-c", "echo $HQ_CPUS"])
576
577 table = hq_env.command(["job", "info", "1"], as_table=True)
578 table.check_row_value("Resources", "cpus: 6 tight")
579 table = hq_env.command(["job", "info", "2"], as_table=True)
580 table.check_row_value("Resources", "cpus: 6 tight!")
581
582 hq_env.start_worker(cpus="[[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24]]")
583 wait_for_job_state(hq_env, [1, 2], "FINISHED")
584
585 hq_env.command(["submit", "--cpus", "6 compact", "--", "bash", "-c", "echo $HQ_CPUS"])
586 hq_env.command(["submit", "--cpus", "6 compact!", "--", "bash", "-c", "echo $HQ_CPUS"])
587
588 wait_for_job_state(hq_env, [3, 4], "FINISHED")
589
590 assert groups(1) == [2, 4]
591 assert groups(2) == [2, 4]
592 assert groups(3) == [3, 3]
593 assert groups(4) == [3, 3]
594
595
596def test_fractional_force_compact(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 6

wait_for_job_stateFunction · 0.85
commandMethod · 0.80
check_row_valueMethod · 0.80
groupsFunction · 0.70
start_serverMethod · 0.45
start_workerMethod · 0.45

Tested by

no test coverage detected