From bcaf49455fc6dacd1e19e32b8457a8bc33991c7a Mon Sep 17 00:00:00 2001 From: Ankit Kala Date: Thu, 6 Jul 2023 21:53:17 +0530 Subject: [PATCH] Flaky test: Add condition to ensure data correctness on primary promotion (#8431) Signed-off-by: Ankit Kala --- .../org/opensearch/indices/replication/SegmentReplicationIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java index 2b879f1c37d88..ac57c78d20b73 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -733,6 +733,7 @@ public void testDropPrimaryDuringReplication() throws Exception { // start another replica. dataNodes.add(internalCluster().startDataOnlyNode()); ensureGreen(INDEX_NAME); + waitForSearchableDocs(initialDocCount, dataNodes); // index another doc and refresh - without this the new replica won't catch up. String docId = String.valueOf(initialDocCount + 1);