test: strip mode-forcing env from nested compositor spawns
A leaked WLR_BACKENDS (e.g. drm,libinput) or KICK_MODE in the ambient environment flips spawned nested compositors to standalone, where the DRM backend fails and every test dies at boot for reasons unrelated to what it asserts. Seen when running the suite from a shell carrying the agent session's own WLR_BACKENDS export. Strip just those two (host connection and socket dir must pass through); precedent: kick-in-kick pops and standalone env -i.
This commit is contained in:
parent
d8048fc556
commit
7494fafb89
1 changed files with 18 additions and 3 deletions
|
|
@ -50,6 +50,18 @@ XR = os.path.join(ROOT, "build", "xreqs")
|
|||
LOG = "/tmp/tabtest.log"
|
||||
_log_seq = [0]
|
||||
|
||||
# Nested compositors must boot nested even when the ambient environment
|
||||
# leaks mode-forcing variables (a WLR_BACKENDS=drm,libinput left over from
|
||||
# VT standalone experiments, or KICK_MODE): the leak flips the spawned
|
||||
# compositor to standalone, its DRM backend fails on the busy seat, and the
|
||||
# test dies at boot ("startup tab never mapped") for reasons unrelated to
|
||||
# what it asserts. Strip just those two; the host connection
|
||||
# (WAYLAND_DISPLAY) and socket dir (XDG_RUNTIME_DIR) must pass through, so
|
||||
# `env -i` (as standalone_session uses) is wrong here. Precedent: the
|
||||
# kick-in-kick spawn already pops both via an env dict, and KICK_LIBDECOR
|
||||
# passes through only when set.
|
||||
_NESTED_ENV_STRIP = ["-u", "WLR_BACKENDS", "-u", "KICK_MODE"]
|
||||
|
||||
|
||||
def _fresh_log():
|
||||
"""A unique per-spawn log path.
|
||||
|
|
@ -683,7 +695,8 @@ def session():
|
|||
dump_dir = _mk_dump_dir()
|
||||
|
||||
proc = subprocess.Popen(
|
||||
["env", "KICK_LOG=2", "KICK_SYNTH_INPUT=1",
|
||||
["env"] + _NESTED_ENV_STRIP + [
|
||||
"KICK_LOG=2", "KICK_SYNTH_INPUT=1",
|
||||
"KICK_DUMP_DIR=" + dump_dir,
|
||||
"KICK_REPEAT_DELAY_MS=" + KICK_REPEAT_TEST_DELAY, "stdbuf", "-oL",
|
||||
BIN, f"{WL} '{RED}'", f"{WL} '{BLUE}'"],
|
||||
|
|
@ -2996,7 +3009,8 @@ def _nested_session(*tabs, extra_args=(), repeat_off=True):
|
|||
# KICK_LIBDECOR passes through only when set: an empty value would
|
||||
# force the libdecor path (any non-"0" value does), so default runs
|
||||
# must not see the variable at all.
|
||||
cmd = ["env", "KICK_LOG=2", "KICK_SYNTH_INPUT=1",
|
||||
cmd = ["env"] + _NESTED_ENV_STRIP + [
|
||||
"KICK_LOG=2", "KICK_SYNTH_INPUT=1",
|
||||
"KICK_DUMP_DIR=" + dump_dir,
|
||||
"KICK_REPEAT_DELAY_MS=" + (KICK_REPEAT_TEST_DELAY if repeat_off
|
||||
else KICK_REPEAT_DEFAULT)]
|
||||
|
|
@ -3724,7 +3738,8 @@ def test_no_args_opens_terminal():
|
|||
log = _fresh_log()
|
||||
dump_dir = _mk_dump_dir()
|
||||
proc = subprocess.Popen(
|
||||
["env", "KICK_LOG=2", "KICK_SYNTH_INPUT=1",
|
||||
["env"] + _NESTED_ENV_STRIP + [
|
||||
"KICK_LOG=2", "KICK_SYNTH_INPUT=1",
|
||||
f"TERMINAL={WL} '{RED}'", "KICK_DUMP_DIR=" + dump_dir,
|
||||
"KICK_REPEAT_DELAY_MS=" + KICK_REPEAT_TEST_DELAY,
|
||||
"stdbuf", "-oL", BIN],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue