From 03025e6b8661dc6fab583d416c4379734644877c Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Sun, 11 Sep 2016 13:22:19 -0400 Subject: [PATCH] LUCENE-7445: fix test bug --- .../test/org/apache/lucene/search/TestSearcherManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java index 09b3e42cb5b..2fac35f6010 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestSearcherManager.java @@ -539,7 +539,9 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase { public void testConcurrentIndexCloseSearchAndRefresh() throws Exception { final Directory dir = newFSDirectory(createTempDir()); AtomicReference writerRef = new AtomicReference<>(); - writerRef.set(new IndexWriter(dir, newIndexWriterConfig())); + final MockAnalyzer analyzer = new MockAnalyzer(random()); + analyzer.setMaxTokenLength(IndexWriter.MAX_TERM_LENGTH); + writerRef.set(new IndexWriter(dir, newIndexWriterConfig(analyzer))); AtomicReference mgrRef = new AtomicReference<>(); mgrRef.set(new SearcherManager(writerRef.get(), null)); @@ -561,7 +563,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase { } else { w.rollback(); } - writerRef.set(new IndexWriter(dir, newIndexWriterConfig())); + writerRef.set(new IndexWriter(dir, newIndexWriterConfig(analyzer))); } } docs.close();