a73x

806faea7

test: e2e isolates XDG_RUNTIME_DIR, so the default socket is hermetic

a73x   2026-09-01 15:00

Commit message
test: e2e isolates XDG_RUNTIME_DIR, so the default socket is hermetic

The suite isolated XDG_CONFIG/STATE/CACHE but not XDG_RUNTIME_DIR, so a
leg with a bug that dialed the DEFAULT socket reached the developer's
live daemon at /run/user/*/muxd.sock. Found by the push group's first
RED run: the not-yet-wired 'd upgrade HOST' ignored the host word, sent
an upgrade request to that live daemon, and only the version rule stood
between it and a Debug e2e build exec'd over real sessions. Isolated, a
stray default dial reads "nothing listening" instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

test/e2e_lib.sh
Old New
@@ -146,7 +146,16 @@ defer_rm "$XDG_STATE_HOME"
146 # touch the developer's real ~/.cache/mux. 146 # touch the developer's real ~/.cache/mux.
147 XDG_CACHE_HOME="${TMPDIR:-/tmp}/mux-e2e-cache-$$" 147 XDG_CACHE_HOME="${TMPDIR:-/tmp}/mux-e2e-cache-$$"
148 defer_rm "$XDG_CACHE_HOME" 148 defer_rm "$XDG_CACHE_HOME"
149 export XDG_CONFIG_HOME XDG_STATE_HOME XDG_CACHE_HOME 149 # And XDG_RUNTIME_DIR, which is not a home but names the DEFAULT SOCKET:
150 # every leg here spells --sock, but a leg with a bug in it does not — the
151 # 16_push group's first RED run sent `d upgrade` to the developer's LIVE
152 # daemon at /run/user/*/muxd.sock, and only the version rule stood between
153 # that and an e2e Debug build exec'd over their sessions. Isolated, a stray
154 # default dial reads "nothing listening" instead of someone's real daemon.
155 XDG_RUNTIME_DIR="${TMPDIR:-/tmp}/mux-e2e-run-$$"
156 mkdir -p "$XDG_RUNTIME_DIR"
157 defer_rm "$XDG_RUNTIME_DIR"
158 export XDG_CONFIG_HOME XDG_STATE_HOME XDG_CACHE_HOME XDG_RUNTIME_DIR
150 # ...and the same argument for $SHELL, which is not an XDG home but is read 159 # ...and the same argument for $SHELL, which is not an XDG home but is read
151 # the same way: every daemon this suite AUTO-STARTS gets no --shell flag and 160 # the same way: every daemon this suite AUTO-STARTS gets no --shell flag and
152 # resolves $SHELL, so without this the suite runs the developer's login 161 # resolves $SHELL, so without this the suite runs the developer's login