Browse Source

Fix ClusterRerouteIT Often Sleeping 30s Needlessly (#77690)

We run the close requests while allocation is disabled. This means, we would
always run down the clock on the request timeout only to find that no shards
are active still.
Armin Braun 4 years ago
parent
commit
b91b8992e3

+ 2 - 2
server/src/internalClusterTest/java/org/elasticsearch/cluster/allocation/ClusterRerouteIT.java

@@ -97,7 +97,7 @@ public class ClusterRerouteIT extends ESIntegTestCase {
                 .execute().actionGet();
                 .execute().actionGet();
 
 
         if (randomBoolean()) {
         if (randomBoolean()) {
-            client().admin().indices().prepareClose("test").get();
+            client().admin().indices().prepareClose("test").setWaitForActiveShards(ActiveShardCount.NONE).get();
         }
         }
 
 
         ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();
         ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();
@@ -232,7 +232,7 @@ public class ClusterRerouteIT extends ESIntegTestCase {
 
 
         final boolean closed = randomBoolean();
         final boolean closed = randomBoolean();
         if (closed) {
         if (closed) {
-            client().admin().indices().prepareClose("test").get();
+            client().admin().indices().prepareClose("test").setWaitForActiveShards(ActiveShardCount.NONE).get();
         }
         }
 
 
         ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();
         ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();