From 396b8b371cba3f5524334d55239e9ba8b3b7fa1c Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Sun, 26 Feb 2017 19:15:33 +0100 Subject: [PATCH] reduce the number of iterations in testPrimaryRelocationWhileIndexing and flush every 5 Without flushing the translog doubles it's size on every recovery --- .../indices/recovery/IndexPrimaryRelocationIT.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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();