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:
+3
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user