[TEST] Wait for nodes before calling the API stats API

This commit is contained in:
Simon Willnauer 2014-09-16 19:35:21 +02:00
parent 2083ca0aa3
commit d2e19ea665

View File

@ -64,13 +64,13 @@ public class ClusterStatsTests extends ElasticsearchIntegrationTest {
assertCounts(response.getNodesStats().getCounts(), 2, 1, 0, 1, 0); assertCounts(response.getNodesStats().getCounts(), 2, 1, 0, 1, 0);
internalCluster().startNode(ImmutableSettings.builder().put("node.master", false)); internalCluster().startNode(ImmutableSettings.builder().put("node.master", false));
response = client().admin().cluster().prepareClusterStats().get();
waitForNodes(3); waitForNodes(3);
response = client().admin().cluster().prepareClusterStats().get();
assertCounts(response.getNodesStats().getCounts(), 3, 1, 1, 1, 0); assertCounts(response.getNodesStats().getCounts(), 3, 1, 1, 1, 0);
internalCluster().startNode(ImmutableSettings.builder().put("node.client", true)); internalCluster().startNode(ImmutableSettings.builder().put("node.client", true));
response = client().admin().cluster().prepareClusterStats().get();
waitForNodes(4); waitForNodes(4);
response = client().admin().cluster().prepareClusterStats().get();
assertCounts(response.getNodesStats().getCounts(), 4, 1, 1, 1, 1); assertCounts(response.getNodesStats().getCounts(), 4, 1, 1, 1, 1);
} }