fix: stabilize flaky TestControlRequestFeatureEnabled#915
Merged
mattisonchao merged 4 commits intomainfrom Feb 27, 2026
Merged
Conversation
d8ff28d to
0bc4ffb
Compare
The test had two flaky assertions: 1. Strict equality check that followers are exactly 1 commit offset behind the leader - replaced with assert.Eventually that waits for followers to catch up 2. Point-in-time checksum comparison across replicas without waiting for follower replication to complete - replaced with assert.Eventually that waits for follower checksums to match the leader Also increased assert.Eventually timeouts from 10s to 30s for robustness under CI load. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0bc4ffb to
e9dc144
Compare
The test was flaky because commit notifications are piggybacked on replication messages, so followers never learn the last committed entry's status without a subsequent write. - Write all keys before checking feature enabled (flushes the feature-enable commit notification to followers) - Record leader checksum, then write a flush entry to propagate the commit notification for the last key - Wait for followers to reach the recorded commit offset - Compare checksums with assert.Equal for clear error messages Co-Authored-By: Claude Opus 4.6 <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.
Summary
TestControlRequestFeatureEnabledthat intermittently fails withexpected: int(1), actual: int64(2)assert.Eventuallythat waits for followers to catch up to within 1 offset of the leaderTest plan
go vet ./tests/control/...passes