mirror of
https://github.com/apache/lucene.git
synced 2025-02-07 10:38:40 +00:00
speed up extremely slow test methods (runtime 15-30s) (#471)
This commit is contained in:
parent
38762ee8cf
commit
756550f88b
@ -16,8 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.lucene.codecs.simpletext;
|
package org.apache.lucene.codecs.simpletext;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import org.apache.lucene.codecs.Codec;
|
import org.apache.lucene.codecs.Codec;
|
||||||
import org.apache.lucene.index.BaseTermVectorsFormatTestCase;
|
import org.apache.lucene.index.BaseTermVectorsFormatTestCase;
|
||||||
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
|
|
||||||
public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCase {
|
public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCase {
|
||||||
@Override
|
@Override
|
||||||
@ -29,4 +31,18 @@ public class TestSimpleTextTermVectorsFormat extends BaseTermVectorsFormatTestCa
|
|||||||
protected Codec getCodec() {
|
protected Codec getCodec() {
|
||||||
return new SimpleTextCodec();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,6 +303,8 @@ public class TestIndexWriterThreadsToSegments extends LuceneTestCase {
|
|||||||
dir.close();
|
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 {
|
public void testDocsStuckInRAMForever() throws Exception {
|
||||||
Directory dir = newDirectory();
|
Directory dir = newDirectory();
|
||||||
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
|
IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
|
||||||
|
@ -708,7 +708,8 @@ public class TestSortOptimization extends LuceneTestCase {
|
|||||||
Directory dir = newDirectory();
|
Directory dir = newDirectory();
|
||||||
IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());
|
IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig());
|
||||||
List<Long> seqNos = new ArrayList<>();
|
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);
|
long seqNoGenerator = random().nextInt(1000);
|
||||||
for (long i = 0; i < iterations; i++) {
|
for (long i = 0; i < iterations; i++) {
|
||||||
int copies = random().nextInt(100) <= 5 ? 1 : 1 + random().nextInt(5);
|
int copies = random().nextInt(100) <= 5 ? 1 : 1 + random().nextInt(5);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user