From a8121a644f435f7c6341b48ee00cfafad2391625 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Thu, 15 Oct 2026 09:30:29 +0200 Subject: [PATCH] test: isolate capacity workers between GUI tests Drain the shared capacity executor before mocks and the GUI collector are torn down. Full local suite: 574 passed, 9 existing skips; unchanged base reproduces six failures. Generated-with: gpt-6.1-sol (Codex) --- tests/conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 2573a3f..79d3dd0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -53,6 +53,17 @@ def isolated_drive_usage_cache(tmp_path, monkeypatch): monkeypatch.setattr('core.drive_usage.cache_path', lambda: tmp_path / 'drive_usage_cache.json') +@pytest.fixture(autouse=True) +def isolated_capacity_workers(monkeypatch, collect_gui_cycles): + """No queued capacity read or helper survives into the next test. + + Keep each test's mocks installed while draining its workers; the GUI + collector must also remain active until those workers have finished. + """ + yield + shutdown_capacity_executor() + + @pytest.fixture(autouse=True) def synchronous_navigation(monkeypatch): """Legacy tests expect navigate_to() to take effect at once; tests/test_drive_switch.py covers the async path."""