From e1b626b947b96a455817efafa942e05e8cc0910b Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Fri, 26 Jul 2019 16:58:39 +0200 Subject: [PATCH] Ensure index is green in SimpleClusterStateIT.testIndicesOptions() (#44893) SimpleClusterStateIT testIndicesOptions failed in #44817 because it tries to close an index at the beginning of the test. With random index settings, it is possible that the index has a high number of shards (10) and replicas (1), which means that on CI this index can take time to be fully allocated. The close index request can fail in the case where replicas are still recovering operations. Thiscommit adds a simple ensureGreen() at the beginning of the test to be sure that all replicas are started before trying to close the index. closes #44817 --- .../java/org/elasticsearch/cluster/SimpleClusterStateIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/test/java/org/elasticsearch/cluster/SimpleClusterStateIT.java b/server/src/test/java/org/elasticsearch/cluster/SimpleClusterStateIT.java index a22b3c42b93..c4fa46a0a19 100644 --- a/server/src/test/java/org/elasticsearch/cluster/SimpleClusterStateIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/SimpleClusterStateIT.java @@ -257,6 +257,7 @@ public class SimpleClusterStateIT extends ESIntegTestCase { ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().clear().setMetaData(true).setIndices("f*") .get(); assertThat(clusterStateResponse.getState().metaData().indices().size(), is(2)); + ensureGreen("fuu"); // close one index client().admin().indices().close(Requests.closeIndexRequest("fuu")).get();