Private
Public Access
0
0

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.
This commit is contained in:
2026-06-18 14:26:38 -04:00
parent 3fdb259249
commit bf6bc67b85
+3 -1
View File
@@ -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