(hq_env: HqEnv, tmp_path)
| 32 | |
| 33 | |
| 34 | def test_restore_waiting_task(hq_env: HqEnv, tmp_path): |
| 35 | journal_path = os.path.join(tmp_path, "my.journal") |
| 36 | hq_env.start_server(args=["--journal", journal_path]) |
| 37 | hq_env.command(["submit", "--array=0-3", "--", "uname"]) |
| 38 | hq_env.command(["submit", "--", "sleep", "0"]) |
| 39 | hq_env.stop_server() |
| 40 | |
| 41 | hq_env.start_server(args=["--journal", journal_path]) |
| 42 | table = hq_env.command(["job", "list"], as_table=True) |
| 43 | |
| 44 | table.check_columns_value(["ID", "State", "Name"], 0, ["1", "WAITING", "uname"]) |
| 45 | table.check_columns_value(["ID", "State", "Name"], 1, ["2", "WAITING", "sleep"]) |
| 46 | |
| 47 | hq_env.start_worker() |
| 48 | wait_for_job_state(hq_env, [1, 2], "FINISHED") |
| 49 | |
| 50 | |
| 51 | def test_restore_partially_finished_task(hq_env: HqEnv, tmp_path): |
nothing calls this directly
no test coverage detected