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
@@ -710,6 +710,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) {
