From 6eb2c81886ee07da3fbdaafd6da4c050662a6b28 Mon Sep 17 00:00:00 2001 From: jimczi Date: Tue, 25 Jun 2019 10:36:25 +0200 Subject: [PATCH] LUCENE-8848: Fix IndexWriter leak when TestUnifiedHighlighter#testNotReanalyzed is ignored --- .../lucene/search/uhighlight/TestUnifiedHighlighter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java index 2565e7ec884..1e20d43f3af 100644 --- a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java +++ b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighter.java @@ -1362,12 +1362,12 @@ public class TestUnifiedHighlighter extends LuceneTestCase { } public void testNotReanalyzed() throws Exception { - RandomIndexWriter iw = new RandomIndexWriter(random(), dir, indexAnalyzer); - if (fieldType == UHTestHelper.reanalysisType) { return; // we're testing the *other* cases } + RandomIndexWriter iw = new RandomIndexWriter(random(), dir, indexAnalyzer); + Field body = new Field("body", "", fieldType); Document doc = new Document(); doc.add(body);