From 6fe3bd817bb4a5aeebc4e17f5fc145e565efde84 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Tue, 25 Oct 2016 19:36:07 -1000 Subject: [PATCH] Tests: make sure that 2 segments are created in SearchCancellationTests Otherwise, the test fails if forced merge kicks in. --- .../java/org/elasticsearch/search/SearchCancellationTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/test/java/org/elasticsearch/search/SearchCancellationTests.java b/core/src/test/java/org/elasticsearch/search/SearchCancellationTests.java index 5026be9d521..a50b7edf57a 100644 --- a/core/src/test/java/org/elasticsearch/search/SearchCancellationTests.java +++ b/core/src/test/java/org/elasticsearch/search/SearchCancellationTests.java @@ -46,6 +46,7 @@ public class SearchCancellationTests extends ESTestCase { public static void before() throws IOException { dir = newDirectory(); RandomIndexWriter w = new RandomIndexWriter(random(), dir); + w.setDoRandomForceMerge(false); // we need 2 segments indexRandomDocuments(w, TestUtil.nextInt(random(), 2, 20)); w.flush(); indexRandomDocuments(w, TestUtil.nextInt(random(), 1, 20));