diff --git a/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java b/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java index ec1e4b38367..01cb066dda4 100644 --- a/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java +++ b/modules/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java @@ -323,19 +323,6 @@ public class TestTotalFacetCountsCache extends LuceneTestCase { assertTrue("Should be obtained from cache at 8th attempt",totalCounts == TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null)); - // delete a doc from the reader and commit - should recompute - origReader.close(); - origReader = readers[0].indexReader; - readers[0].indexReader = IndexReader.open(origReader.directory(),false); - initCache(); - totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null); - prevGen = assertRecomputed(totalCounts, prevGen, "after opening a writable reader - 9th attempt!"); - // now do the delete - readers[0].indexReader.deleteDocument(1); - readers[0].indexReader.commit(null); - totalCounts = TFC.getTotalCounts(readers[0].indexReader, readers[0].taxReader, iParams, null); - prevGen = assertRecomputed(totalCounts, prevGen, "after deleting docs the index - 10th attempt!"); - origReader.close(); readers[0].close(); r2.close(); diff --git a/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java b/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java index 729090332ed..1c56a9675bb 100644 --- a/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java +++ b/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java @@ -147,7 +147,7 @@ public class TestIndexClose extends LuceneTestCase { } @Override protected IndexReader openIndexReader(Directory dir) throws CorruptIndexException, IOException { - return new InstrumentedIndexReader(IndexReader.open(dir,true)); + return new InstrumentedIndexReader(IndexReader.open(dir)); } } diff --git a/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java b/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java index db16003ee43..a07bfedd523 100644 --- a/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java +++ b/modules/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java @@ -231,14 +231,11 @@ public class TestScoredDocIDsUtils extends LuceneTestCase { for (int docNum = 0; docNum < nDocs; docNum++) { writer.addDocument(docFactory.getDoc(docNum)); } + // Delete documents marked for deletion + writer.deleteDocuments(new Term(DocumentFactory.field, DocumentFactory.delTxt)); writer.close(); - // Delete documents marked for deletion - IndexReader reader = IndexReader.open(dir, false); - reader.deleteDocuments(new Term(DocumentFactory.field, DocumentFactory.delTxt)); - reader.close(); - // Open a fresh read-only reader with the deletions in place - return IndexReader.open(dir, true); + return IndexReader.open(dir); } }