fix: deflake //rs/tests/consensus:replica_determinism_test#8982
Open
basvandijk wants to merge 1 commit intomasterfrom
Open
fix: deflake //rs/tests/consensus:replica_determinism_test#8982basvandijk wants to merge 1 commit intomasterfrom
basvandijk wants to merge 1 commit intomasterfrom
Conversation
After the malicious node restarts and reports healthy, it may still need
time to catch up to the latest state. The canister's wasm module may not
yet be available, or the HTTP endpoint may not be fully ready for call
processing.
Root cause: The second loop of update calls (after node restart) used
.expect("failed to update") with no retry logic. When the restarted
node was healthy but not yet caught up, the first update call would fail
with TransportError (BrokenPipe, ConnectionRefused, TimedOut) or
UncertifiedReject ("Requested canister has no wasm module" IC0537).
Fix: Wrap the first update call after restart in retry_with_msg_async!
(120s timeout, 5s backoff) to allow the node time to fully catch up
before asserting on subsequent calls.
Skill: .claude/skills/fix-flaky-tests/SKILL.md
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.
The
//rs/tests/consensus:replica_determinism_testis slightly flaky:Usually because of the same failure mode:
Claude Opus 4.6 provides the following Root Cause Analysis and accompanying fix:
Root Cause
After the malicious node restarts and reports healthy via
await_status_is_healthy_async(), it may still need time to catch up to the latest state. The canister's wasm module may not yet be available, or the HTTP endpoint may not be fully ready for call processing.The second loop of update calls (after node restart) used
.expect("failed to update")with no retry logic. When the restarted node was healthy but not yet caught up, the first update call would fail with:BrokenPipe,ConnectionRefused, orTimedOut(4 out of 5 flaky runs)"Requested canister has no wasm module"IC0537 (1 out of 5 flaky runs)Fix
Wrap the first update call after restart in
retry_with_msg_async!(120s timeout, 5s backoff) to allow the node time to fully catch up before asserting on subsequent calls. The remaining iterations proceed without retry since after the first succeeds, the node is confirmed to be fully caught up.Skill:
.claude/skills/fix-flaky-tests/SKILL.md.