From bb0baa20fb33c89f9f5bd3f12eda4c07c8ce6852 Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Fri, 13 Sep 2013 15:18:18 +0200 Subject: [PATCH] Removed wrong assertion that makes recoverWhileUnderLoadWithNodeShutdown fail. As we are within an awaitBusy block, it doesn't make sense to have an assertion, since it would fail the test instead of waiting till the condition is verified (till timeout expires) --- .../recovery/RecoveryWhileUnderLoadTests.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/elasticsearch/recovery/RecoveryWhileUnderLoadTests.java b/src/test/java/org/elasticsearch/recovery/RecoveryWhileUnderLoadTests.java index b7a7bedcc69..535e61e5267 100644 --- a/src/test/java/org/elasticsearch/recovery/RecoveryWhileUnderLoadTests.java +++ b/src/test/java/org/elasticsearch/recovery/RecoveryWhileUnderLoadTests.java @@ -122,7 +122,7 @@ public class RecoveryWhileUnderLoadTests extends AbstractSharedClusterTest { logger.info("--> indexing threads stopped"); logger.info("--> refreshing the index"); - refreshAndAssert(10); + refreshAndAssert(); logger.info("--> verifying indexed content"); iterateAssertCount(5, indexCounter.get(), 10); } @@ -196,7 +196,7 @@ public class RecoveryWhileUnderLoadTests extends AbstractSharedClusterTest { logger.info("--> indexing threads stopped"); logger.info("--> refreshing the index"); - refreshAndAssert(10); + refreshAndAssert(); logger.info("--> verifying indexed content"); iterateAssertCount(5, indexCounter.get(), 10); } @@ -287,7 +287,7 @@ public class RecoveryWhileUnderLoadTests extends AbstractSharedClusterTest { assertThat(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setTimeout("1m").setWaitForYellowStatus().setWaitForNodes(">=1").execute().actionGet().isTimedOut(), equalTo(false)); logger.info("--> refreshing the index"); - refreshAndAssert(10); + refreshAndAssert(); logger.info("--> verifying indexed content"); iterateAssertCount(5, indexCounter.get(), 10); @@ -331,13 +331,12 @@ public class RecoveryWhileUnderLoadTests extends AbstractSharedClusterTest { logger.info("iteration [{}] - returned documents: {} (expected {})", iteration, countResponse.getCount(), numberOfDocs); } - private void refreshAndAssert(final int numberOfShards) throws InterruptedException { + private void refreshAndAssert() throws InterruptedException { assertThat(awaitBusy(new Predicate() { public boolean apply(Object o) { try { RefreshResponse actionGet = client().admin().indices().prepareRefresh().execute().actionGet(); assertNoFailures(actionGet); - assertThat(actionGet.getSuccessfulShards(), equalTo(numberOfShards)); return actionGet.getTotalShards() == actionGet.getSuccessfulShards(); } catch (Throwable e) { throw new RuntimeException(e);