qemu: power-signal test waits for the trap install (rebuild) #23

Merged
noah merged 1 commits from rb/lf-fix-sdk22 into rebuild 2026-10-17 21:19:13 -06:00
Owner

Test-harness flake fix (no product change). Fixes #22.

qemu/tests/init-power-signals-test.sh sent each signal after a fixed 0.5 s sleep; on a loaded runner the shell had not installed its traps yet, so SIGTERM killed it with nothing written (seen on #21, job 36166). Each case now waits for the signal's bit in /proc/<pid>/status SigCgt (10 s hang backstop, WARDEN_TEST_TRAP_WAIT_S) and fails clearly if the handler never appears.

Regression: a case whose handler install is held back 1.5 s, plus a check that the wait gives up on a shell without a handler.

Local gate:

$ taskset -c 0-3 nice -n 19 bash qemu/tests/init-power-signals-test.sh   (twice)
[PASS] SIGTERM (busybox reboot) reboots at once
[PASS] SIGUSR2 (busybox poweroff) powers off at once
[PASS] SIGUSR1 (busybox halt) powers off at once
[PASS] SIGTERM after a slow handler install still reboots
[PASS] wait_trapped gives up on a shell without a handler
EXIT 0
$ shellcheck qemu/tests/init-power-signals-test.sh   -> 0 findings
# mutation: wait_trapped replaced by the old `sleep 0.5`
[FAIL] SIGTERM after a slow handler install still reboots (got: )
EXIT 1

Twin: the same commit goes to rebuild and flare-edge-next.

Generated with Claude Code

https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG

Test-harness flake fix (no product change). Fixes #22. `qemu/tests/init-power-signals-test.sh` sent each signal after a fixed 0.5 s sleep; on a loaded runner the shell had not installed its traps yet, so SIGTERM killed it with nothing written (seen on #21, job 36166). Each case now waits for the signal's bit in `/proc/<pid>/status` SigCgt (10 s hang backstop, `WARDEN_TEST_TRAP_WAIT_S`) and fails clearly if the handler never appears. Regression: a case whose handler install is held back 1.5 s, plus a check that the wait gives up on a shell without a handler. Local gate: ``` $ taskset -c 0-3 nice -n 19 bash qemu/tests/init-power-signals-test.sh (twice) [PASS] SIGTERM (busybox reboot) reboots at once [PASS] SIGUSR2 (busybox poweroff) powers off at once [PASS] SIGUSR1 (busybox halt) powers off at once [PASS] SIGTERM after a slow handler install still reboots [PASS] wait_trapped gives up on a shell without a handler EXIT 0 $ shellcheck qemu/tests/init-power-signals-test.sh -> 0 findings # mutation: wait_trapped replaced by the old `sleep 0.5` [FAIL] SIGTERM after a slow handler install still reboots (got: ) EXIT 1 ``` Twin: the same commit goes to rebuild and flare-edge-next. Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah added 1 commit 2026-10-17 17:51:20 -06:00
qemu: power-signal test waits for the trap install (#22)
ci / mcdc (pull_request) Successful in 16s
ci / test (push) Successful in 10s
ci / mcdc (push) Successful in 17s
ci / bench (push) Successful in 5s
ci / qemu-tools (push) Successful in 50s
ci / patches-apply (push) Successful in 24s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / kernel-symbols (push) Successful in 2m40s
ci / test (pull_request) Successful in 9s
ci / quality (push) Successful in 34s
ci / badges (push) Skipped
ci / bench (pull_request) Successful in 7s
ci / qemu-tools (pull_request) Successful in 54s
ci / prune-artifacts (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 27s
ci / kernel-symbols (pull_request) Successful in 2m30s
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 44s
ci / badges (pull_request) Skipped
be4ad86230
init-power-signals-test.sh slept a fixed 0.5 s before sending each signal.
On a loaded runner the shell had not installed its traps yet, so SIGTERM
took its default action and the case failed with nothing written.

Each case now polls /proc/<pid>/status until SigCgt has the signal's bit
(10 s hang backstop, WARDEN_TEST_TRAP_WAIT_S), and fails clearly if the
handler never appears. Regression: a case whose handler install is held
back 1.5 s (fails on the old fixed sleep), plus a check that the wait gives
up on a shell without a handler.

Fixes #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah merged commit f435a7d665 into rebuild 2026-10-17 21:19:13 -06:00
noah deleted branch rb/lf-fix-sdk22 2026-10-17 21:19:13 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blueflare/bfe-core1106-sdk#23