From 8757c2f6e1c321b743114a413873f82636304046 Mon Sep 17 00:00:00 2001 From: Ali Beyad Date: Mon, 29 Aug 2016 14:46:35 -0400 Subject: [PATCH] Changes tests to conform with new cluster health API, calling setWaitForNoRelocatingShards(true) instead of setWaitForRelocatingShards(0) Original commit: elastic/x-pack-elasticsearch@c7c12fe64cfa6caec5412b80d677b3723d764743 --- .../java/org/elasticsearch/xpack/security/MigrateToolIT.java | 5 +---- .../org/elasticsearch/license/TribeTransportTestCase.java | 2 +- .../xpack/security/audit/index/IndexAuditTrailTests.java | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolIT.java b/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolIT.java index 00361ffefe2..a1989873f09 100644 --- a/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolIT.java +++ b/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolIT.java @@ -13,11 +13,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.client.Requests; import org.elasticsearch.common.Priority; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.env.Environment; -import org.elasticsearch.xpack.security.SecurityTemplateService; import org.elasticsearch.xpack.security.action.role.GetRolesResponse; import org.elasticsearch.xpack.security.action.user.GetUsersResponse; import org.elasticsearch.xpack.security.action.user.PutUserResponse; @@ -123,7 +120,7 @@ public class MigrateToolIT extends MigrateToolTestCase { .timeout(TimeValue.timeValueSeconds(30)) .waitForYellowStatus() .waitForEvents(Priority.LANGUID) - .waitForRelocatingShards(0)) + .waitForNoRelocatingShards(true)) .actionGet(); SearchResponse searchResp = client.filterWithHeader(Collections.singletonMap("Authorization", token)).prepareSearch("index1").get(); } diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java index 08c066e5f28..69154a2edb9 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java @@ -203,7 +203,7 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { private void ensureYellow(TestCluster testCluster) { ClusterHealthResponse actionGet = testCluster.client().admin().cluster() .health(Requests.clusterHealthRequest().waitForYellowStatus() - .waitForEvents(Priority.LANGUID).waitForRelocatingShards(0)).actionGet(); + .waitForEvents(Priority.LANGUID).waitForNoRelocatingShards(true)).actionGet(); if (actionGet.isTimedOut()) { logger.info("ensureGreen timed out, cluster state:\n{}\n{}", testCluster.client().admin().cluster() .prepareState().get().getState().prettyPrint(), diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java index 7118f687fc5..6ed3520f046 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java @@ -736,7 +736,7 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase { // pretty ugly but just a rip of ensureYellow that uses a different client ClusterHealthResponse actionGet = getClient().admin().cluster().health(Requests.clusterHealthRequest(indices) - .waitForRelocatingShards(0).waitForYellowStatus().waitForEvents(Priority.LANGUID)).actionGet(); + .waitForNoRelocatingShards(true).waitForYellowStatus().waitForEvents(Priority.LANGUID)).actionGet(); if (actionGet.isTimedOut()) { logger.info("ensureYellow timed out, cluster state:\n{}\n{}", getClient().admin().cluster().prepareState().get().getState().prettyPrint(),