fix(test): single shared workspace, remove per-worker subdirs (keep lock mechanism)
This commit is contained in:
+4
-4
@@ -482,10 +482,9 @@ def live_gui(request) -> Generator["_LiveGuiHandle", None, None]:
|
|||||||
diag = VerificationLogger("live_gui_startup", "live_gui_diag")
|
diag = VerificationLogger("live_gui_startup", "live_gui_diag")
|
||||||
diag.log_state("GUI Script", "N/A", "gui_2.py")
|
diag.log_state("GUI Script", "N/A", "gui_2.py")
|
||||||
|
|
||||||
# 1. Create a per-worker subdirectory under the run workspace so xdist workers
|
# 1. Create the run workspace (one per pytest invocation, shared by the
|
||||||
# don't pollute the main directory or collide on port 8999.
|
# single owner worker that actually runs live_gui tests).
|
||||||
_worker_id = os.environ.get("PYTEST_XDIST_WORKER", "master")
|
temp_workspace = _RUN_WORKSPACE
|
||||||
temp_workspace = _RUN_WORKSPACE / _worker_id
|
|
||||||
if temp_workspace.exists():
|
if temp_workspace.exists():
|
||||||
for _ in range(5):
|
for _ in range(5):
|
||||||
try:
|
try:
|
||||||
@@ -558,6 +557,7 @@ def live_gui(request) -> Generator["_LiveGuiHandle", None, None]:
|
|||||||
# the lock and wait for the hook server to come up, then yield a client
|
# the lock and wait for the hook server to come up, then yield a client
|
||||||
# handle (process=None; teardown skips kill + workspace cleanup). This
|
# handle (process=None; teardown skips kill + workspace cleanup). This
|
||||||
# serializes I/O on port 8999 so we don't try to run live_gui in parallel.
|
# serializes I/O on port 8999 so we don't try to run live_gui in parallel.
|
||||||
|
_worker_id = os.environ.get("PYTEST_XDIST_WORKER", "master")
|
||||||
_owner_lock = temp_workspace / ".live_gui_owner.lock"
|
_owner_lock = temp_workspace / ".live_gui_owner.lock"
|
||||||
_is_owner = False
|
_is_owner = False
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user