From f9d5643c01b6fcfa136369762dcb589f9f71e3d3 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 3 Jan 2013 20:02:01 +0000 Subject: [PATCH] add commented out assert that finds more bugs git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1428565 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/TestIndexWriter.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java index 6c213dcdcd0..4828f392763 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -1045,16 +1045,15 @@ public class TestIndexWriter extends LuceneTestCase { } if (random.nextInt(3) == 0) { IndexReader r = null; - boolean success = false; try { r = DirectoryReader.open(w, random.nextBoolean()); - success = true; + // TODO: more bugs! + // if (random.nextBoolean() && r.maxDoc() > 0) { + // int docid = random.nextInt(r.maxDoc()); + // w.tryDeleteDocument(r, docid); + //} } finally { - if (success) { - r.close(); - } else { - IOUtils.closeWhileHandlingException(r); - } + IOUtils.closeWhileHandlingException(r); } } if (i%10 == 0) {