From 21e3b12b94c7a95e39611fce82033b5f618e4efc Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 2 Aug 2026 18:42:39 -0400 Subject: [PATCH] tests: relax 5s pytest-timeout marks that flake on slow CI runners 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 --- tests/app/services/model_install/test_model_install.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/app/services/model_install/test_model_install.py b/tests/app/services/model_install/test_model_install.py index 6c0fc1138ef..8d94205237e 100644 --- a/tests/app/services/model_install/test_model_install.py +++ b/tests/app/services/model_install/test_model_install.py @@ -686,7 +686,7 @@ def test_prune_jobs_rebind_preserves_existing_iterators( assert all(job not in mm2_installer.list_jobs() for job in jobs) -@pytest.mark.timeout(timeout=5, method="thread") +@pytest.mark.timeout(timeout=30, method="thread") def test_prune_jobs_waits_for_the_installer_lock(mm2_installer: ModelInstallServiceBase) -> None: lock_held = threading.Event() release_lock = threading.Event() @@ -714,7 +714,7 @@ def _hold_lock() -> None: assert prune_completed.is_set() -@pytest.mark.timeout(timeout=5, method="thread") +@pytest.mark.timeout(timeout=30, method="thread") def test_import_and_wait_for_installs_fail_before_start( mm2_app_config: InvokeAIAppConfig, mm2_record_store, @@ -736,7 +736,7 @@ def test_import_and_wait_for_installs_fail_before_start( installer.wait_for_installs(timeout=0.1) -@pytest.mark.timeout(timeout=5, method="thread") +@pytest.mark.timeout(timeout=30, method="thread") def test_import_fails_after_startup_failure( mm2_app_config: InvokeAIAppConfig, mm2_record_store, @@ -768,7 +768,7 @@ def _fail_startup() -> None: installer.stop() -@pytest.mark.timeout(timeout=5, method="thread") +@pytest.mark.timeout(timeout=30, method="thread") def test_base_exception_during_startup_releases_import_waiters( mm2_app_config: InvokeAIAppConfig, mm2_record_store,