Test: added health call to will hold when wait when there is a cluster block, so that the refresh call doesn't fail if that is the case.

This commit is contained in:
Martijn van Groningen 2015-03-05 20:32:23 +01:00
parent cea8999406
commit 274da68040
1 changed files with 3 additions and 0 deletions

View File

@ -296,6 +296,9 @@ public class RecoveryFromGatewayTests extends ElasticsearchIntegrationTest {
if (numNodes == 1) { if (numNodes == 1) {
logger.info("--> one node is closed - start indexing data into the second one"); logger.info("--> one node is closed - start indexing data into the second one");
client.prepareIndex("test", "type1", "3").setSource(jsonBuilder().startObject().field("field", "value3").endObject()).execute().actionGet(); client.prepareIndex("test", "type1", "3").setSource(jsonBuilder().startObject().field("field", "value3").endObject()).execute().actionGet();
// TODO: remove once refresh doesn't fail immediately if there a master block:
// https://github.com/elasticsearch/elasticsearch/issues/9997
client.admin().cluster().prepareHealth("test").setWaitForYellowStatus().get();
client.admin().indices().prepareRefresh().execute().actionGet(); client.admin().indices().prepareRefresh().execute().actionGet();
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {