Skip to content

tests: relax 5s pytest-timeout marks that flake on slow CI runners - #9448

Merged
lstein merged 1 commit into
mainfrom
test/relax-model-install-timeouts
Aug 2, 2026
Merged

tests: relax 5s pytest-timeout marks that flake on slow CI runners#9448
lstein merged 1 commit into
mainfrom
test/relax-model-install-timeouts

Conversation

@lstein

@lstein lstein commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bumps the four @pytest.mark.timeout(timeout=5, method="thread") marks in tests/app/services/model_install/test_model_install.py (added in #9433) to timeout=30, matching the other timeout marks in the file.

Why

With method="thread", the timeout budget covers fixture setup and teardown as well as the test body. Tearing down the mm2_download_queue fixture alone takes up to ~1s (stop() joins five worker threads that poll the queue at a 1-second interval), and on a heavily loaded CI runner the total easily exceeds 5s.

This flaked twice on the same day, on different platforms and unrelated branches:

  • py3.11: windows-cpu on fix: don't hold VRAM in an idle server (CUDA context at startup) #9447: timed out in test_base_exception_during_startup_releases_import_waiters, during download-queue teardown (job). The same run's slowness is visible elsewhere — test_missing_models.py took 98s for 9 tests.
  • py3.11: linux-cpu on feat/fp8_quantized_guard: timed out in test_import_fails_after_startup_failure (job).

Neither stack dump showed a deadlock — the download workers were sitting in their normal 1-second poll loop and the main thread was in routine teardown. The runner was just slow.

The timeout marks exist to catch hangs, not to enforce speed, so the larger budget loses nothing: a genuine hang still fails, just 25 seconds later.

Testing

  • The four affected tests pass locally in 7.5s total.

🤖 Generated with Claude Code

The four timeout=5 marks added in #9433 use method="thread", so the
5-second budget covers fixture setup and teardown as well as the test
body. Tearing down the mm2_download_queue fixture alone takes up to
~1s (five worker threads polling the queue at a 1-second interval),
and on a heavily loaded CI runner the total easily exceeds 5s: the
py3.11 windows-cpu job on #9447 timed out in
test_base_exception_during_startup_releases_import_waiters during
download-queue teardown, and an unrelated branch hit the same timeout
in test_import_fails_after_startup_failure on linux-cpu the same day.
Neither dump showed a deadlock - the workers were in their normal poll
loop.

Bump these marks to 30s, matching the other timeout marks in this
file. The timeouts exist to catch hangs, not to enforce speed, so the
larger budget loses nothing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lstein
lstein enabled auto-merge (squash) August 2, 2026 22:59
@github-actions github-actions Bot added the python-tests PRs that change python tests label Aug 2, 2026
@lstein
lstein merged commit 0805ad4 into main Aug 2, 2026
17 checks passed
@lstein
lstein deleted the test/relax-model-install-timeouts branch August 2, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants