[Test] testIsolateMasterAndVerifyClusterStateConsensus didn't wait on initializing shards before comparing cluster states

This commit is contained in:
Boaz Leskes 2014-06-13 11:35:01 +02:00
parent f3d90cdb17
commit e39ac7eef4
1 changed files with 3 additions and 4 deletions

View File

@ -297,7 +297,7 @@ public class DiscoveryWithNetworkFailuresTests extends ElasticsearchIntegrationT
@Test
@TestLogging("discovery.zen:TRACE,action:TRACE,cluster.service:TRACE,indices.recovery:TRACE,indices.cluster:TRACE")
public void voidIsolateMasterAndVerifyClusterStateConsensus() throws Exception {
public void testIsolateMasterAndVerifyClusterStateConsensus() throws Exception {
final List<String> nodes = internalCluster().startNodesAsync(3, nodeSettings).get();
ensureStableCluster(3);
@ -329,9 +329,8 @@ public class DiscoveryWithNetworkFailuresTests extends ElasticsearchIntegrationT
logger.info("issue a reroute");
// trigger a reroute now, instead of waiting for the background reroute of RerouteService
assertAcked(client().admin().cluster().prepareReroute());
// and wait for it to finish.
assertFalse(client().admin().cluster().prepareHealth().setWaitForRelocatingShards(0).get().isTimedOut());
// and wait for it to finish and for the cluster to stabilize
ensureGreen("test");
// verify all cluster states are the same
ClusterState state = null;