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
This commit is contained in:
Boaz Leskes 2018-04-16 17:43:40 +02:00
parent 69aabb7e40
commit 8f91743768
1 changed files with 3 additions and 0 deletions

View File

@ -698,6 +698,9 @@ public class FullClusterRestartIT extends ESRestTestCase {
shouldHaveTranslog = randomBoolean();
indexRandomDocuments(count, true, true, i -> jsonBuilder().startObject().field("field", "value").endObject());
// make sure all recoveries are done
ensureNoInitializingShards();
// Explicitly flush so we're sure to have a bunch of documents in the Lucene index
client().performRequest("POST", "/_flush");
if (shouldHaveTranslog) {