fix(test): remove live_gui skip gate — lock mechanism handles coordination
This commit is contained in:
+5
-11
@@ -135,19 +135,13 @@ def pytest_unconfigure(config: object) -> None:
|
||||
|
||||
def pytest_collection_modifyitems(config: object, items: list[object]) -> None:
|
||||
"""
|
||||
xdist worker gate: only gw0 (or the master, if not running under xdist)
|
||||
actually runs tests that depend on the live_gui fixture. Other workers
|
||||
deselect those tests to avoid port-8999 collisions and to honor the
|
||||
"don't multi-thread live_gui" directive.
|
||||
No-op. The live_gui fixture uses a file-based lock to serialize ownership
|
||||
of the sloppy.py subprocess: the first worker to acquire the lock spawns
|
||||
it, other workers wait for the hook server and yield a client handle.
|
||||
All workers CAN run live_gui tests; the lock prevents port-8999 collisions.
|
||||
[C: tests/conftest.py:live_gui fixture]
|
||||
"""
|
||||
_worker = os.environ.get("PYTEST_XDIST_WORKER", "master")
|
||||
if _worker in ("master", "gw0"):
|
||||
return
|
||||
_skip = pytest.mark.skip(reason=f"live_gui tests only run on master/gw0 (this worker is {_worker})")
|
||||
for item in items:
|
||||
if "live_gui" in getattr(item, "fixturenames", ()):
|
||||
item.add_marker(_skip)
|
||||
return
|
||||
|
||||
_REQUIRED_TEST_IMPORTS: list[tuple[str, str]] = [
|
||||
("sentence_transformers", "sentence-transformers"),
|
||||
|
||||
Reference in New Issue
Block a user