diff --git a/tests/test_smoke.py b/tests/test_smoke.py index 66ceb97..d9f550a 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -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],