Make sure all shards are refreshed during recovery test
This commit is contained in:
parent
f3a35ccc90
commit
020e68f2a0
|
@ -294,7 +294,6 @@ public class RecoveryWhileUnderLoadTests extends AbstractSharedClusterTest {
|
||||||
logger.info("--> refreshing the index");
|
logger.info("--> refreshing the index");
|
||||||
refreshAndAssert();
|
refreshAndAssert();
|
||||||
logger.info("--> verifying indexed content");
|
logger.info("--> verifying indexed content");
|
||||||
refreshAndAssert();
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
CountResponse actionGet = client().prepareCount().setQuery(matchAllQuery()).execute().actionGet();
|
CountResponse actionGet = client().prepareCount().setQuery(matchAllQuery()).execute().actionGet();
|
||||||
assertNoFailures(actionGet);
|
assertNoFailures(actionGet);
|
||||||
|
@ -302,10 +301,18 @@ public class RecoveryWhileUnderLoadTests extends AbstractSharedClusterTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private RefreshResponse refreshAndAssert() {
|
private void refreshAndAssert() throws InterruptedException {
|
||||||
RefreshResponse actionGet = client().admin().indices().prepareRefresh().execute().actionGet();
|
assertThat(awaitBusy(new Predicate<Object>() {
|
||||||
assertNoFailures(actionGet);
|
public boolean apply(Object o) {
|
||||||
return actionGet;
|
try {
|
||||||
|
RefreshResponse actionGet = client().admin().indices().prepareRefresh().execute().actionGet();
|
||||||
|
assertNoFailures(actionGet);
|
||||||
|
return actionGet.getTotalShards() == actionGet.getSuccessfulShards();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 5, TimeUnit.MINUTES), equalTo(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void waitForDocs(final long numDocs) throws InterruptedException {
|
private void waitForDocs(final long numDocs) throws InterruptedException {
|
||||||
|
|
Loading…
Reference in New Issue