LUCENE-3176: checkindex/close ourselves for safety and to support tests.iter

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1133385 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-06-08 13:08:00 +00:00
parent 8df95b97ef
commit e934e3849f
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,7 @@ public class TestNRTThreads extends LuceneTestCase {
final LineFileDocs docs = new LineFileDocs(random);
final File tempDir = _TestUtil.getTempDir("nrtopenfiles");
final MockDirectoryWrapper dir = newFSDirectory(tempDir);
dir.setCheckIndexOnClose(false); // don't double-checkIndex, we do it ourselves.
final IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random));
if (LuceneTestCase.TEST_NIGHTLY) {
@ -565,8 +566,10 @@ public class TestNRTThreads extends LuceneTestCase {
assertFalse(writer.anyNonBulkMerges);
writer.close(false);
_TestUtil.checkIndex(dir);
s.close();
dir.close();
_TestUtil.rmDir(tempDir);
docs.close();
if (VERBOSE) {
System.out.println("TEST: done [" + (System.currentTimeMillis()-t0) + " ms]");