mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 15:02:20 +02:00
test: keep pytest basetemp within the AF_UNIX path limit
Moving TMPDIR into the private runtime root left pytest's default <TMPDIR>/pytest-of-<user>/pytest-<n> beneath it. With xdist's popen-gw<n> the real-tmux witness bound a 110-byte socket path, over Linux's 107-byte sun_path limit, so it failed under every worker count while passing serially. The controller now roots basetemp at the private root's pytest directory; xdist hands workers popen-gw<n> beneath it. An explicit --basetemp wins. A tmux-independent witness binds a socket at the same path budget.
This commit is contained in:
@@ -14,7 +14,7 @@ def bootstrap_runtime():
|
||||
if os.environ.get("APP_PORT") and not worker:
|
||||
return None
|
||||
runtime = isolated_runtime(worker or "main")
|
||||
runtime.__enter__()
|
||||
runtime.root = runtime.__enter__()
|
||||
return runtime
|
||||
|
||||
|
||||
@@ -22,6 +22,12 @@ def configure_runtime(config, runtime):
|
||||
"""Register ownership even when configuration or collection fails."""
|
||||
if runtime is not None:
|
||||
config.add_cleanup(lambda: runtime.__exit__(None, None, None))
|
||||
# pytest's default <TMPDIR>/pytest-of-<user>/pytest-<n> beneath the
|
||||
# private TMPDIR, plus xdist's popen-gw<n>, overflows the 107-byte
|
||||
# AF_UNIX limit for sockets in tmp_path. Workers inherit a basetemp
|
||||
# under the controller's; an explicit --basetemp still wins.
|
||||
if config.option.basetemp is None and not hasattr(config, "workerinput"):
|
||||
config.option.basetemp = str(runtime.root / "pytest")
|
||||
parallel = bool(getattr(config.option, "numprocesses", None)) or hasattr(config, "workerinput")
|
||||
# This consumes the existing test option; its public read and documented
|
||||
# source location remain in the static-server fixture.
|
||||
|
||||
Reference in New Issue
Block a user