diff --git a/core/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java b/core/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java index 450744d64df..71fe7caabcf 100644 --- a/core/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java +++ b/core/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java @@ -249,8 +249,7 @@ public class MinimumMasterNodesIT extends ESIntegTestCase { String[] newNodes = internalCluster().startNodes(2, settings).stream().toArray(String[]::new); ensureGreen(); - clusterHealthResponse = client().admin().cluster().prepareHealth().setWaitForNodes("4").execute().actionGet(); - assertThat(clusterHealthResponse.isTimedOut(), equalTo(false)); + internalCluster().validateClusterFormed(); state = client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.nodes().getSize(), equalTo(4)); diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java index cf9c2dc3515..c4e191e75c5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java @@ -1059,13 +1059,13 @@ public final class InternalTestCluster extends TestCluster { } /** ensure a cluster is formed with all published nodes. */ - private void validateClusterFormed() { + public synchronized void validateClusterFormed() { String name = randomFrom(random, getNodeNames()); validateClusterFormed(name); } /** ensure a cluster is formed with all published nodes, but do so by using the client of the specified node */ - private void validateClusterFormed(String viaNode) { + public synchronized void validateClusterFormed(String viaNode) { Set expectedNodes = new HashSet<>(); for (NodeAndClient nodeAndClient : nodes.values()) { expectedNodes.add(getInstanceFromNode(ClusterService.class, nodeAndClient.node()).localNode());