Submit an allocation that will forever be returned as an error when trying to get its status. After some time, that allocation should be removed, to allow new allocations to be started.
(hq_env: HqEnv, flavor: ManagerFlavor)
| 374 | |
| 375 | @all_flavors |
| 376 | def test_repeated_status_error(hq_env: HqEnv, flavor: ManagerFlavor): |
| 377 | """ |
| 378 | Submit an allocation that will forever be returned as an error when trying to get its status. |
| 379 | After some time, that allocation should be removed, to allow new allocations to be started. |
| 380 | """ |
| 381 | first_job = default_job_id() |
| 382 | |
| 383 | class FailingStatusManager(CommandHandler): |
| 384 | async def handle_status(self, job_ids: List[JobId]) -> Dict[JobId, JobData]: |
| 385 | if first_job in job_ids: |
| 386 | raise ManagerException("Failed to get allocation status") |
| 387 | return await super().handle_status(job_ids) |
| 388 | |
| 389 | with MockJobManager(hq_env, FailingStatusManager(flavor.create_adapter())): |
| 390 | start_server_with_quick_refresh(hq_env) |
| 391 | prepare_tasks(hq_env) |
| 392 | |
| 393 | add_queue(hq_env, manager=flavor.manager_type(), backlog=1) |
| 394 | # Check that after many status failures, the job is deemed to be finished and a new one is |
| 395 | # queued. |
| 396 | wait_for_alloc(hq_env, "FAILED", first_job) |
| 397 | wait_for_alloc(hq_env, "QUEUED", default_job_id(1)) |
| 398 | |
| 399 | |
| 400 | @all_flavors |
nothing calls this directly
no test coverage detected