Tests: make sure that 2 segments are created in SearchCancellationTests

Otherwise, the test fails if forced merge kicks in.
This commit is contained in:
Igor Motov 2016-10-25 19:36:07 -10:00
parent 9c3e4d6e22
commit 6fe3bd817b
1 changed files with 1 additions and 0 deletions

View File

@ -46,6 +46,7 @@ public class SearchCancellationTests extends ESTestCase {
public static void before() throws IOException { public static void before() throws IOException {
dir = newDirectory(); dir = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random(), dir); RandomIndexWriter w = new RandomIndexWriter(random(), dir);
w.setDoRandomForceMerge(false); // we need 2 segments
indexRandomDocuments(w, TestUtil.nextInt(random(), 2, 20)); indexRandomDocuments(w, TestUtil.nextInt(random(), 2, 20));
w.flush(); w.flush();
indexRandomDocuments(w, TestUtil.nextInt(random(), 1, 20)); indexRandomDocuments(w, TestUtil.nextInt(random(), 1, 20));