From 583085d7e8e19840af99457b80e944bf7e421394 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Fri, 26 Jan 2018 15:31:29 -0500 Subject: [PATCH] Increase timeout for ensureGreen in testShrinkIndexPrimaryTerm If we have created 210 shards, we may need more than 30 seconds for all shards become green. Relates #28153 --- .../action/admin/indices/create/ShrinkIndexIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java b/server/src/test/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java index 982b9456b8c..f35bad9f128 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java @@ -47,6 +47,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDeci import org.elasticsearch.common.Priority; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; @@ -164,7 +165,8 @@ public class ShrinkIndexIT extends ESIntegTestCase { assertThat(dataNodes.size(), greaterThanOrEqualTo(2)); final DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); final String mergeNode = discoveryNodes[0].getName(); - ensureGreen(); + // This needs more than the default timeout if 210(2*3*5*7) shards were created. + ensureGreen(TimeValue.timeValueSeconds(120)); // fail random primary shards to force primary terms to increase final Index source = resolveIndex("source");