From dcb2107a1d48097fb65594a0ffb98b8e5b99e30d Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Mon, 14 Jul 2014 15:12:07 +0200 Subject: [PATCH] [Test] testSingleNodeWithFlush should wait for yellow O.w. it can restart a node before all primaries are started , leading to a red state down the road... --- .../gateway/local/SimpleRecoveryLocalGatewayTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/org/elasticsearch/gateway/local/SimpleRecoveryLocalGatewayTests.java b/src/test/java/org/elasticsearch/gateway/local/SimpleRecoveryLocalGatewayTests.java index e8111dfa85f..31573edd12c 100644 --- a/src/test/java/org/elasticsearch/gateway/local/SimpleRecoveryLocalGatewayTests.java +++ b/src/test/java/org/elasticsearch/gateway/local/SimpleRecoveryLocalGatewayTests.java @@ -208,6 +208,9 @@ public class SimpleRecoveryLocalGatewayTests extends ElasticsearchIntegrationTes assertHitCount(client().prepareCount().setQuery(matchAllQuery()).execute().actionGet(), 2); + ensureYellow("test"); // wait for primary allocations here otherwise if we have a lot of shards we might have a + // shard that is still in post recovery when we restart and the ensureYellow() below will timeout + internalCluster().fullRestart(); logger.info("Running Cluster Health (wait for the shards to startup)");