(hq_env: HqEnv)
| 570 | |
| 571 | |
| 572 | def 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 | |
| 596 | def test_fractional_force_compact(hq_env: HqEnv): |
nothing calls this directly
no test coverage detected