LUCENE-7445: fix test bug

This commit is contained in:
Mike McCandless 2016-09-11 13:22:19 -04:00
parent 9f3964c9a6
commit 03025e6b86
1 changed files with 4 additions and 2 deletions

View File

@ -539,7 +539,9 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
public void testConcurrentIndexCloseSearchAndRefresh() throws Exception { public void testConcurrentIndexCloseSearchAndRefresh() throws Exception {
final Directory dir = newFSDirectory(createTempDir()); final Directory dir = newFSDirectory(createTempDir());
AtomicReference<IndexWriter> writerRef = new AtomicReference<>(); AtomicReference<IndexWriter> 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<SearcherManager> mgrRef = new AtomicReference<>(); AtomicReference<SearcherManager> mgrRef = new AtomicReference<>();
mgrRef.set(new SearcherManager(writerRef.get(), null)); mgrRef.set(new SearcherManager(writerRef.get(), null));
@ -561,7 +563,7 @@ public class TestSearcherManager extends ThreadedIndexingAndSearchingTestCase {
} else { } else {
w.rollback(); w.rollback();
} }
writerRef.set(new IndexWriter(dir, newIndexWriterConfig())); writerRef.set(new IndexWriter(dir, newIndexWriterConfig(analyzer)));
} }
} }
docs.close(); docs.close();