From 217a52be5b4a686dfa328f5463491393c39f472a Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 14 Sep 2021 12:56:14 +0200 Subject: [PATCH] Fix ClusterRerouteIT Often Sleeping 30s Needlessly 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. --- .../elasticsearch/cluster/allocation/ClusterRerouteIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/allocation/ClusterRerouteIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/allocation/ClusterRerouteIT.java index 5a923f4f44d0a..0debeb18a900f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/allocation/ClusterRerouteIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/allocation/ClusterRerouteIT.java @@ -97,7 +97,7 @@ private void rerouteWithCommands(Settings commonSettings) throws Exception { .execute().actionGet(); 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(); @@ -232,7 +232,7 @@ private void rerouteWithAllocateLocalGateway(Settings commonSettings) throws Exc final boolean closed = randomBoolean(); 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();