[TEST] Make sure all shards are allocated before killing a random data node.

This commit is contained in:
Martijn van Groningen 2014-07-31 12:14:42 +02:00 committed by Boaz Leskes
parent 403ebc9e07
commit 47326adb67
1 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,7 @@ package org.elasticsearch.cluster;
import org.elasticsearch.action.ActionRequestBuilder;
import com.google.common.base.Predicate;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.count.CountResponse;
import org.elasticsearch.action.get.GetResponse;
@ -225,6 +226,11 @@ public class NoMasterNodeTests extends ElasticsearchIntegrationTest {
client().prepareIndex("test2", "type1", "1").setSource("field", "value1").get();
refresh();
ensureSearchable("test1", "test2");
ClusterStateResponse clusterState = client().admin().cluster().prepareState().get();
logger.info("Cluster state:\n" + clusterState.getState().prettyPrint());
internalCluster().stopRandomDataNode();
assertThat(awaitBusy(new Predicate<Object>() {
public boolean apply(Object o) {