speed up extremely slow test methods (runtime 15-30s) (#471)

This commit is contained in:
Robert Muir 2021-11-28 09:40:43 -05:00
parent 38762ee8cf
commit 756550f88b
No known key found for this signature in database
GPG Key ID: 817AE1DD322D7ECA
3 changed files with 20 additions and 1 deletions

View File

@ -16,8 +16,10 @@
*/
package org.apache.lucene.codecs.simpletext;
import java.io.IOException;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseTermVectorsFormatTestCase;
import org.apache.lucene.util.LuceneTestCase;
public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCase {
@Override
@ -29,4 +31,18 @@ public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCa
protected Codec getCodec() {
return new SimpleTextCodec();
}
// TODO: can we speed up the underlying base test?
@Override
@LuceneTestCase.Nightly
public void testMergeWithIndexSort() throws IOException {
super.testMergeWithIndexSort();
}
// TODO: can we speed up the underlying base test?
@Override
@LuceneTestCase.Nightly
public void testMergeWithoutIndexSort() throws IOException {
super.testMergeWithoutIndexSort();
}
}

View File

@ -303,6 +303,8 @@ public class TestIndexWriterThreadsToSegments extends LuceneTestCase {
dir.close();
}
// TODO: can we make this test more efficient so it doesn't need to be nightly?
@LuceneTestCase.Nightly
public void testDocsStuckInRAMForever() throws Exception {
Directory dir = newDirectory();
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));

View File

@ -708,7 +708,8 @@ public class TestSortOptimization extends LuceneTestCase {
Directory dir = newDirectory();
IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());
List<Long> seqNos = new ArrayList<>();
int iterations = 10000 + random().nextInt(10000);
int limit = TEST_NIGHTLY ? 10000 : 1000;
int iterations = limit + random().nextInt(limit);
long seqNoGenerator = random().nextInt(1000);
for (long i = 0; i < iterations; i++) {
int copies = random().nextInt(100) <= 5 ? 1 : 1 + random().nextInt(5);