Wait until index is in the clusterstate after restart

This commit is contained in:
Simon Willnauer 2013-12-16 19:52:00 +01:00
parent 34b9b16233
commit 1dc8c079da
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ public class QuorumLocalGatewayTests extends ElasticsearchIntegrationTest {
@Override
public boolean apply(Object input) {
ClusterStateResponse clusterStateResponse = cluster().smartClient().admin().cluster().prepareState().setMasterNodeTimeout("500ms").get();
return clusterStateResponse.getState() != null;
return clusterStateResponse.getState() != null && clusterStateResponse.getState().routingTable().index("test") != null;
}}), equalTo(true)); // wait until we get a cluster state - could be null if we quick enough.
final ClusterStateResponse clusterStateResponse = cluster().smartClient().admin().cluster().prepareState().setMasterNodeTimeout("500ms").get();
assertThat(clusterStateResponse.getState(), notNullValue());