Repository navigation
Make updater startup, migration and recovery tests wait for observed events - #1197
Conversation
There was a problem hiding this comment.
ℹ️ Two non-blocking timing issues remain.
Approach The supervisor tests can drive state changes from child exits, readiness markers, and saved receipts, which directly observe the transitions these tests exercise.
Reviewed changes I reviewed the updater controller fixtures and traced their waits through the supervisor.
- Startup and launcher clears. The tests make a real loopback request after the fixture publishes its port, advance scheduled receipt retries, and verify the saved launcher hash and cleared selection.
- Paired recovery. The test recovers from a refused cold restore before inducing and checking exit status 7 and a separate readiness timeout.
- Core migration. The maintenance child publishes its ephemeral address so the test can probe it during the migration wait.
cargo fmt --check -p jmodguard-updater passed. I reviewed the timing paths statically and did not rerun the updater tests.
Non-blocking
- The paired readiness log can appear after the API start log.
tick_pair_memberresumes when the bot's ready file appears, butCHILDappendsnew-bot.readyin a separate write afterward. If the child is descheduled between those operations, the supervisor can correctly accept readiness and start the API, which can lognew-api.startbefore the bot's log entry. Record the fixture's readiness event before creating the marker so observing the marker guarantees the log entry is already present. Fixture publication · Ordering assertion - The migration health check can fail after 200 ms. The bound-address marker is published before the child accepts requests. A delay in scheduling the child after publication can therefore trip the single probe's 200 ms timeout even though the maintenance child would answer within the test's five-second deadline. Let the single HTTP exchange use the enclosing timeout. Migration probe · Probe timeout
gpt-6.2-sol | 𝕏
|
Addressed both findings in 9486390. The ready event is visible before the child publishes its readiness marker. Forcing the bot to pause immediately after that publication reproduced the old event-order failure and confirmed the new order. The migration case now makes one health request under its five-second deadline. Delaying the real maintenance child’s response by 600 ms failed on the previous commit and passed on this one. A 503 still failed the assertion, and a held response failed at the outer deadline. All 187 updater tests and 64 focused repetitions passed. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes I reviewed 9486390 against the prior Pullfrog review at 3bd3792. It addresses both timing findings.
- Recorded readiness before publishing the marker. The paired recovery test can observe the bot's marker and start the API only after the bot's readiness event is in the log.
- Used the full migration deadline for the health probe. The single loopback request uses the enclosing five-second timeout. The shared reader handles short reads, and the existing polling callers retain their 200 ms per-attempt timeout.
cargo +1.100.0 fmt --check -p jmodguard-updater passed locally. Updater test execution results are from the author's PR report.
gpt-6.2-sol | 𝕏

Part of #666. Fourteen updater tests used 29 real-clock reads and 27 fixed sleeps while waiting for children, recovery receipts or migration. The fixtures now observe child exit and readiness publication, issue real loopback requests, and advance the retry deadlines established by the supervisor.
The paired recovery test previously accepted the error left by a refused cold restore as evidence that a later child had exited. It now proves both launchers stopped, performs owner recovery, and checks the fresh exit-7 failure and readiness timeout independently. The launcher-clear tests verify that the first application read succeeds before writer activation and that the launcher hash and cleared selection are persisted.
Verification
Follow-up commit 9486390 records the child’s ready event before publishing the marker. The migration test uses one HTTP request under its five-second deadline. A forced preemption reproduced the old event order. A 600 ms response failed the old health probe and passed the new one, while a 503 and a response held past the deadline still failed. All 187 package tests and 64 focused repetitions passed on the follow-up.
Summary by Sourcery
Make updater tests wait for observable lifecycle events and verify recovery and launcher-clear outcomes explicitly.
Enhancements:
Tests: