Skip to content

Commit b91b899

Browse files
Fix ClusterRerouteIT Often Sleeping 30s Needlessly (elastic#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.
1 parent db239e2 commit b91b899

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/internalClusterTest/java/org/elasticsearch/cluster/allocation/ClusterRerouteIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private void rerouteWithCommands(Settings commonSettings) throws Exception {
9797
.execute().actionGet();
9898

9999
if (randomBoolean()) {
100-
client().admin().indices().prepareClose("test").get();
100+
client().admin().indices().prepareClose("test").setWaitForActiveShards(ActiveShardCount.NONE).get();
101101
}
102102

103103
ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();
@@ -232,7 +232,7 @@ private void rerouteWithAllocateLocalGateway(Settings commonSettings) throws Exc
232232

233233
final boolean closed = randomBoolean();
234234
if (closed) {
235-
client().admin().indices().prepareClose("test").get();
235+
client().admin().indices().prepareClose("test").setWaitForActiveShards(ActiveShardCount.NONE).get();
236236
}
237237

238238
ClusterState state = client().admin().cluster().prepareState().execute().actionGet().getState();

0 commit comments

Comments
 (0)