-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flaky test SegmentReplicationIT.testReplicaAlreadyAtCheckpoint #17216
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sandeep Kumawat <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17216 +/- ##
============================================
- Coverage 72.34% 72.31% -0.03%
- Complexity 65731 65747 +16
============================================
Files 5318 5318
Lines 305743 305741 -2
Branches 44350 44350
============================================
- Hits 221182 221095 -87
- Misses 66394 66573 +179
+ Partials 18167 18073 -94 ☔ View full report in Codecov by Sentry. |
@@ -1892,6 +1892,7 @@ public void testReplicaAlreadyAtCheckpoint() throws Exception { | |||
// index a doc. | |||
client().prepareIndex(INDEX_NAME).setId("1").setSource("foo", randomInt()).get(); | |||
refresh(INDEX_NAME); | |||
waitForSearchableDocs(1, primaryNode, replicaNode, replicaNode2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At which step does the test fails? can you share more details about the failure (since i could not get that clearly from description)?
Description
In the SegmentReplicationIT.testReplicaAlreadyAtCheckpoint test, we are creating three nodes with one primary node and two replica nodes. After ingesting documents to the primary shard, we are not checking if the segment replication to both replica 1 and 2 has finished. Without verifying this, we are stopping the primary node. This behavior leads to the test being flaky when the replication has not completed.
With this change we are ensuring replication has finished before stopping the primary node.
Related Issues
Resolves #14328
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.