From 1e182a44e436f8553eca543fe7c73fccb2e29dfb Mon Sep 17 00:00:00 2001 From: BFE Engineering Date: Sat, 31 Oct 2026 18:49:45 -0600 Subject: [PATCH] qemu: agent-test.sh counts a zombie child as killed (CI containers reap nothing) Run 10403: under a CI job container's non-reaping PID 1 the script child the deadline killed stays a zombie, and kill -0 still found it. The check now reads the process state from /proc. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS --- qemu/tests/agent-test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu/tests/agent-test.sh b/qemu/tests/agent-test.sh index db9d8ec..be034ee 100755 --- a/qemu/tests/agent-test.sh +++ b/qemu/tests/agent-test.sh @@ -80,7 +80,10 @@ took=$(( $(date +%s) - start )) check "a script past its deadline answers 124" grep -qx '<>' "$WORK/late.out" check "the deadline holds (took ${took}s)" test "$took" -le 5 child="$(cat "$WORK/child.pid" 2>/dev/null)" -check "the script's child is killed too" bash -c "[ -n '$child' ] && ! kill -0 '$child' 2>/dev/null" +# Gone or a zombie: in a CI job container PID 1 reaps nothing, so a killed +# orphan stays a zombie that kill -0 still finds. +gone() { [ ! -r "/proc/$1/stat" ] || [ "$(sed 's/.*) //' "/proc/$1/stat" | cut -d' ' -f1)" = Z ]; } +check "the script's child is killed too" bash -c "[ -n '$child' ] && $(declare -f gone); sleep 0.5; gone '$child'" check "the agent answers after a timeout" grep -qx '<>' "$WORK/late.out" # Malformed requests: one error line each, nothing runs.