Smoke test: keep the server's own process id, and check that it stops
llembas-tty / linux (push) Failing after 37s
llembas-tty / linux (push) Failing after 37s
Started through a shell function, the id kept was the subshell's, and the server outlived the test. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+9
-3
@@ -41,8 +41,12 @@ if [ "$P" = LLEMBAS_TTY ]; then
|
||||
fi
|
||||
|
||||
# A WezTerm that started us must not be passed on, nor talked to.
|
||||
clean env WEZTERM_PANE=77 WEZTERM_UNIX_SOCKET="$work/run/not-ours" WEZTERM_CONFIG_FILE="$work/nope.lua" \
|
||||
"$MUX" > "$work/server.txt" 2>&1 &
|
||||
# (exec, so that the process id we keep is the server's own and stopping it stops the server)
|
||||
(
|
||||
exec env -i PATH=/usr/bin:/bin HOME="$work/home" XDG_RUNTIME_DIR="$work/run" XDG_CONFIG_HOME="$work/cfg" \
|
||||
WEZTERM_PANE=77 WEZTERM_UNIX_SOCKET="$work/run/not-ours" WEZTERM_CONFIG_FILE="$work/nope.lua" \
|
||||
"$MUX"
|
||||
) > "$work/server.txt" 2>&1 &
|
||||
pid=$!
|
||||
sock="$work/run/$APPDIR/sock"
|
||||
for _ in $(seq 40); do
|
||||
@@ -73,7 +77,9 @@ sleep 0.5
|
||||
expect "send-text --no-paste arrives, get-text reads it" "$(cli get-text --pane-id "$pane")" 'typed by the cli'
|
||||
expect "cli list shows the pane" "$(cli list)" "(^|[^0-9])$pane([^0-9]|$)"
|
||||
|
||||
kill "$pid" 2>/dev/null; wait "$pid" 2>/dev/null; pid=""
|
||||
kill "$pid" 2>/dev/null; wait "$pid" 2>/dev/null
|
||||
if kill -0 "$pid" 2>/dev/null; then bad "the server did not stop"; else ok "the server stops when told"; fi
|
||||
pid=""
|
||||
|
||||
if [ "$P" = LLEMBAS_TTY ]; then
|
||||
# The built-in configuration applied the layer: its keys are bound. And a person's own file
|
||||
|
||||
Reference in new issue
Block a user