qemu: a reboot tap may lose the control channel; expect_reboot looks back one step #8

Merged
noah merged 1 commits from qemu-reboot-tap-race into flare-edge-next 2026-09-28 21:23:10 -06:00
1 Commits
Author SHA1 Message Date
NoahandClaude Opus 5.5 6576a4a506 qemu: a reboot tap may lose the control channel; expect_reboot looks back one step
ci / test (pull_request) Successful in 13s
ci / mcdc (pull_request) Successful in 13s
ci / bench (pull_request) Successful in 6s
ci / qemu-tools (pull_request) Successful in 40s
ci / patches-apply (push) Successful in 15s
ci / qemu-tools (push) Successful in 42s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / prune-artifacts (pull_request) Skipped
ci / kernel-build (pull_request) Skipped
ci / patches-apply (pull_request) Successful in 15s
ci / test (push) Successful in 12s
ci / quality (pull_request) Successful in 28s
ci / badges (pull_request) Skipped
ci / mcdc (push) Successful in 13s
ci / bench (push) Successful in 6s
ci / quality (push) Successful in 1m5s
ci / badges (push) Skipped
A tap whose outcome is a reboot races init tearing warden-ui down: the
control channel can close while the tap's press/release counts are still
polled, which made the tap FATAL, and a fast guest can print its restart
line before expect_reboot starts, which expect_reboot then ignored.
flare-edge's Reboot flow passed about half its rig runs (flare-edge#233).

drive() now tells each step the next command and the console size when the
previous step began. A tap followed by expect_reboot that loses the channel
after its press went out is ok; expect_reboot reads the console from the
start of the step before it. Anything earlier still does not count.

Tests: RebootTapRace (3 cases) in test_qmp_drive.py; the old driver fails
the main one. Rig: settings/system-reboot-restarts 4/4 sequential passes,
each through the channel-close path (next: 2/4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01441BzdGcvQmXkiN2qDjfZg
2026-09-28 20:30:57 -06:00