Repository navigation
test: fix two flaky tests (maintenance lock, interrupted update worker) - #199
Merged
Merged
Conversation
pending_journal_blocks_other_installs_after_lock_owner_dies took the shared lease right after dropping the exclusive one. Another test that spawns a process meanwhile holds a copy of the dropped descriptor in the child until it execs, and the lock with it, so the last shared_in failed now and then (CI on #188). With a thread spawning `true` in a loop it failed 37 times in 300. The test now retries while the lock is held (as once_free does for the other test in the file), and checks that the first refusal is for the pending journal, not for the lock: before, a held lock passed that assertion too. 0 failures in 300 under the same load. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…failed recovers_after_process_death_using_only_durable_records failed now and then (macOS CI on #198, Linux locally on 2026-11-24): the worker it starts ended without being killed, and its output went to /dev/null, so why was lost. - the worker's output goes to a file in the fixture directory and is shown when it isn't killed (a file, not a pipe: the fixture daemon it starts keeps the descriptor, and reading a pipe to its end would wait for that daemon) - Store::open is retried while the updater lock is held: another test that spawns a process meanwhile keeps a copy of a dropped lock's descriptor in the child until it execs, the race fixed for maintenance in the previous commit - the fixture daemon's spawn is retried on ETXTBSY (text file busy), the same race for the script just written, as archive.rs does for the real candidate Neither race reproduced on Linux (60 runs under a process-spawning thread, 40 full test binaries at 32 threads); the output will tell if it is another cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Two tests that failed now and then in CI, fixed together (tests only, no product code).
maintenance::tests::pending_journal_blocks_other_installs_after_lock_owner_dies(CI on perf(viewer): one MJPEG stream per phone, one rotation sampler #188): it took the shared lease right after dropping the exclusive one. Another test that spawns a process meanwhile keeps a copy of the dropped descriptor in the child until it execs, and the lock with it. It now retries while the lock is held (asonce_freedoes for the other test in the file), and checks that the first refusal is for the pending journal, not the lock (before, a held lock passed that assertion too). With a thread spawningtruein a loop: 37 failures in 300 before, 0 in 300 after.update::transaction::tests::recovers_after_process_death_using_only_durable_records(macOS CI on fix: low-level crates (review P0-C) #198; Linux locally on 2026-11-24): the worker it starts ended without being killed (signal()wasNone). Its output went to/dev/null, so the reason was lost.output()hung).Store::openis retried while the updater lock is held: the same race as above, for its non-blockingflock.ETXTBSY: the same race for the script just written, asarchive.rsalready does for the real candidate.Tests
cargo test -p iphone-control update::: 41 passed;cargo test -p ictl-daemon maintenance: passed; clippy-D warningsiphone-controltest binary 30 times at--test-threads=32: 0 failures, no hang🤖 Generated with Claude Code