init-power-signals-test races the trap install with a fixed 0.5 s sleep #22

Closed
opened 2026-10-17 17:19:55 -06:00 by noah · 2 comments
Owner

Seen on PR #21 (job 36166, flare-edge-next): qemu/tests/init-power-signals-test.sh printed [FAIL] SIGTERM (busybox reboot) reboots at once (got: ) while the SIGUSR2 and SIGUSR1 cases passed. #21 only touches qemu/tests/qmp.py.

Cause: run_case starts the shell in the background, sleeps a fixed 0.5 s, then sends the signal. On a loaded runner warden_trap_power_signals has not installed its traps yet, so SIGTERM takes its default action and kills the shell, and nothing is written.

Fix: before kill, poll /proc/$pid/status until SigCgt has the signal's bit set (bounded, for example 10 s), and fail clearly if it never is. Add a regression check with a delayed trap install. Twins on rebuild and flare-edge-next. Test harness only.

Seen on PR #21 (job 36166, flare-edge-next): `qemu/tests/init-power-signals-test.sh` printed `[FAIL] SIGTERM (busybox reboot) reboots at once (got: )` while the SIGUSR2 and SIGUSR1 cases passed. #21 only touches qemu/tests/qmp.py. Cause: `run_case` starts the shell in the background, sleeps a fixed 0.5 s, then sends the signal. On a loaded runner `warden_trap_power_signals` has not installed its traps yet, so SIGTERM takes its default action and kills the shell, and nothing is written. Fix: before `kill`, poll `/proc/$pid/status` until `SigCgt` has the signal's bit set (bounded, for example 10 s), and fail clearly if it never is. Add a regression check with a delayed trap install. Twins on rebuild and flare-edge-next. Test harness only.
Author
Owner

Fixed by #23 (rebuild, be4ad86) and #24 (flare-edge-next, 3b41543): each case waits for the signal bit in /proc//status SigCgt (10 s backstop) before kill. Regression: a case with the trap install held back 1.5 s fails on the old fixed sleep and passes now; the wait also gives up cleanly on a shell without a handler.

Fixed by #23 (rebuild, be4ad86) and #24 (flare-edge-next, 3b41543): each case waits for the signal bit in /proc/<pid>/status SigCgt (10 s backstop) before kill. Regression: a case with the trap install held back 1.5 s fails on the old fixed sleep and passes now; the wait also gives up cleanly on a shell without a handler.
noah closed this issue 2026-10-17 21:19:13 -06:00
Author
Owner

Fixed by #23 (rebuild) and #24 (flare-edge-next), both merged.

Fixed by #23 (rebuild) and #24 (flare-edge-next), both merged.
noah reopened this issue 2026-10-17 21:19:27 -06:00
noah closed this issue 2026-10-17 21:19:48 -06:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blueflare/bfe-core1106-sdk#22