From 8f104cc08c46a00233c61abe84eaed301b7a9526 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 8 Dec 2017 12:35:02 +0100 Subject: [PATCH] [TEST] Now actually wait for merges Relates to #27651 --- .../java/org/elasticsearch/index/shard/IndexShardTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index ebf39b7e089..e4b1eb083b5 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -2856,7 +2856,7 @@ public class IndexShardTests extends IndexShardTestCase { // We need to wait for all ongoing merges to complete. The reason is that during a merge the // IndexWriter holds the core cache key open and causes the memory to be registered in the breaker - primary.forceMerge(new ForceMergeRequest()); + primary.forceMerge(new ForceMergeRequest().maxNumSegments(1).flush(true)); // Close remaining searchers IOUtils.close(searchers);