Repository navigation
Synchronize updater child-exit and health handoff tests - #1198
Conversation
There was a problem hiding this comment.
ℹ️ Two non-blocking test findings.
Approach Directly observing child exit, health handoff, and entry into the control read makes the ordering assertions more reliable while exercising the real launcher, child processes, and SQLite pool.
Reviewed changes I reviewed both updater files and ran all 146 launcher tests successfully with cargo test --locked -p jmodguard-updater --bin jmodguard-launcher.
- Child exit and health handoff. The tests await process, task, or marker events and probe the launcher’s HTTP responses while database work is stalled.
- Retry timing. Three crash scenarios tick just before the first retry deadline on a fixed clock. Two also verify that the replacement starts at the deadline.
Non-blocking
- The pending-receipt test still races the crash deadline. If the test task is descheduled for a full
POLLafter recording the crash, its nexttick()can restart the child and fail the hold assertions. Use the fixture clock already available in this PR to drive the held tick and the retry. Pending-receipt fixture - Five general child-exit tests now require
pidfd_open. The new calls panic on hosts where the syscall is unavailable, including Linux kernels before 5.3. The launcher supports these hosts through its PID fallback. Give the fixture wait a bounded, non-reaping PID fallback so these scenarios can still run there. Fixture call · Launcher fallback · Linux syscall documentation
gpt-6.2-sol | 𝕏
|
Both findings are addressed in ed51674. The pending-receipt case drives the real supervisor one nanosecond before the first crash deadline and again exactly at it. A 5.3-second pause failed the old case and passed the revised one. The general child-exit fixtures now use a bounded |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed 58ebc63..ed51674. All 146 launcher tests passed. The five general child-exit cases also passed with pidfd_open forced to return ENOSYS.
- Replaced the exit wait. The fixture now uses
waitid(P_PID, …, WNOWAIT)so the supervisor can still reap the child when it resumes. - Drove the pending-receipt retry deadline. The test checks that the restart is held one nanosecond before the deadline and observes the replacement start at the deadline while SQLite is blocked.
- Made auth recovery ordering explicit. The unsaved-candidate case uses current-thread Tokio and checks that
normal()handles the exit with the watcher disarmed.
gpt-6.2-sol | 𝕏

Part of #666. Seventeen updater tests now observe child exit, socket ownership and admission to the control read directly. They keep the real child processes, launcher HTTP responses and occupied SQLite connections. The supervisor's observation points compile only in test builds.
Four crash-recovery tests could fail if the test task was descheduled for the entire five-second backoff. They now check the first retry deadline and exercise the supervisor immediately before that deadline. The three cases that restart the child advance the fixture clock to the deadline and observe the replacement.
Verification
Tested together with #1199, the two PRs merge cleanly into tree
a5e71a3b61cefc388b0f472960868d7aa0035d32. On that exact tree, pinned Dylint passed across the full workspace with zero test-flake diagnostics, and all 187 updater package tests passed.Summary by Sourcery
Make updater child-exit, health handoff, and crash-retry tests deterministic under scheduling delays.
Enhancements:
Tests: