Index: lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java =================================================================== --- lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java (revision 1095068) +++ lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java (working copy) @@ -941,16 +941,15 @@ } final LineFileDocs docs = new LineFileDocs(random); - final int RUN_TIME_SEC = LuceneTestCase.TEST_NIGHTLY ? 100 : 1; final IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(-1).setRAMBufferSizeMB(64); final File tempDir = _TestUtil.getTempDir("fstlines"); - final MockDirectoryWrapper dir = new MockDirectoryWrapper(random, FSDirectory.open(tempDir)); + final MockDirectoryWrapper dir = newFSDirectory(tempDir); final IndexWriter writer = new IndexWriter(dir, conf); writer.setInfoStream(VERBOSE ? System.out : null); - final long stopTime = System.currentTimeMillis() + RUN_TIME_SEC * 1000; + final long stopDocs = LuceneTestCase.TEST_NIGHTLY ? _TestUtil.nextInt(random, 100000, 500000) : _TestUtil.nextInt(random, 1000, 5000); Document doc; int docCount = 0; - while((doc = docs.nextDoc()) != null && System.currentTimeMillis() < stopTime) { + while((doc = docs.nextDoc()) != null && docCount < stopDocs) { writer.addDocument(doc); docCount++; }