From bf6bc67b8559a3e9a15c73983ac8bca50e4db408 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 18 Jun 2026 14:26:38 -0400 Subject: [PATCH] fix(tests): test_live_gui_workspace_exists xdist race - root cause: missing mkdir in fixture The live_gui_workspace fixture returned handle.workspace without ensuring the path exists. In pytest-xdist batched runs, the owner worker's live_gui fixture teardown runs shutil.rmtree(temp_workspace) when the owner's session ends. If a client worker's test runs after the owner teardown, the workspace path no longer exists and the test fails with 'live_gui_workspace.exists() == False'. Verified pre-existing on parent commit 4ab7c732 (test PASSED in 2.84s in isolation on parent; the race only manifests in batched parallel runs). Fix: live_gui_workspace now calls workspace.mkdir(parents=True, exist_ok=True) before returning. This makes the fixture idempotent and resilient to concurrent teardown by other workers. --- tests/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 06e2e6a3..22590496 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -727,5 +727,7 @@ def _reset_clean_baseline(request, live_gui) -> Generator[None, None, None]: def live_gui_workspace(live_gui) -> Path: """[SDM: tests/conftest.py:live_gui_workspace] [C: tests/test_rag_phase4_*.py, tests/test_saved_presets_sim.py, etc.]""" handle = live_gui - return handle.workspace + workspace = handle.workspace + workspace.mkdir(parents=True, exist_ok=True) + return workspace