diff --git a/core/src/test/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java b/core/src/test/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java index 1c4ec5db915..7de5862b855 100644 --- a/core/src/test/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java +++ b/core/src/test/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java @@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.equalTo; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST) public class IndexPrimaryRelocationIT extends ESIntegTestCase { - private static final int RELOCATION_COUNT = 25; + private static final int RELOCATION_COUNT = 15; @TestLogging("_root:DEBUG,org.elasticsearch.action.bulk:TRACE,org.elasticsearch.index.shard:TRACE,org.elasticsearch.cluster.service:TRACE") public void testPrimaryRelocationWhileIndexing() throws Exception { @@ -88,7 +88,10 @@ public class IndexPrimaryRelocationIT extends ESIntegTestCase { if (indexingThread.isAlive() == false) { // indexing process aborted early, no need for more relocations as test has already failed break; } - + if (i > 0 && i % 5 == 0) { + logger.info("--> [iteration {}] flushing index", i); + client().admin().indices().prepareFlush("test").get(); + } } finished.set(true); indexingThread.join();