Skip to content

Commit 9bd3d3f

Browse files
committed
FullClusterRestartIT.testRecovery should wait for all initializing shards
Shards that are not fully bake may not execute the flush call, causing subsequent unexpected translog recoveries which fails the test. Closes #27817
1 parent ca9d1b4 commit 9bd3d3f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,9 @@ public void testRecovery() throws IOException {
710710
shouldHaveTranslog = randomBoolean();
711711

712712
indexRandomDocuments(count, true, true, i -> jsonBuilder().startObject().field("field", "value").endObject());
713+
714+
// make sure all recoveries are done
715+
ensureNoInitializingShards();
713716
// Explicitly flush so we're sure to have a bunch of documents in the Lucene index
714717
client().performRequest("POST", "/_flush");
715718
if (shouldHaveTranslog) {

0 commit comments

Comments
 (0)