LUCENE-9814: fix extremely slow 7.0 backwards tests in master

The 7.0 backwards tests added to master must have come from an older
branch before they were fixed: they've added minutes to my test times.

These tests have already been fixed in master, so that the crazy
corner-case stress tests are only running slowly in jekins and we dont
have 15-30s long tests locally.

Re-applying same fixes to 7.0 tests removes minutes from my test times.
This commit is contained in:
Robert Muir 2021-02-26 20:24:01 -05:00
parent 4f6469b173
commit 373e1d6c83
No known key found for this signature in database
GPG Key ID: 817AE1DD322D7ECA
2 changed files with 16 additions and 12 deletions

View File

@ -137,7 +137,8 @@ public class TestIndexedDISI extends LuceneTestCase {
public void testFewMissingDocs() throws IOException {
try (Directory dir = newDirectory()) {
for (int iter = 0; iter < 100; ++iter) {
int numIters = atLeast(10);
for (int iter = 0; iter < numIters; ++iter) {
int maxDoc = TestUtil.nextInt(random(), 1, 100000);
FixedBitSet set = new FixedBitSet(maxDoc);
set.set(0, maxDoc);
@ -152,7 +153,8 @@ public class TestIndexedDISI extends LuceneTestCase {
public void testRandom() throws IOException {
try (Directory dir = newDirectory()) {
for (int i = 0; i < 10; ++i) {
int numIters = atLeast(3);
for (int i = 0; i < numIters; ++i) {
doTestRandom(dir);
}
}

View File

@ -84,7 +84,8 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
public void testSortedSetVariableLengthBigVsStoredFields() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
doTestSortedSetVsStoredFields(atLeast(300), 1, 32766, 16, 100);
int numDocs = TEST_NIGHTLY ? atLeast(100) : atLeast(10);
doTestSortedSetVsStoredFields(numDocs, 1, 32766, 16, 100);
}
}
@ -100,7 +101,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
public void testSortedVariableLengthBigVsStoredFields() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
doTestSortedVsStoredFields(atLeast(300), 1d, 1, 32766);
doTestSortedVsStoredFields(atLeast(100), 1d, 1, 32766);
}
}
@ -112,7 +113,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
}
}
@Slow
@Nightly
public void testTermsEnumFixedWidth() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
@ -122,7 +123,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
}
}
@Slow
@Nightly
public void testTermsEnumVariableWidth() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
@ -142,6 +143,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
}
}
@Nightly
public void testTermsEnumLongSharedPrefixes() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
@ -446,7 +448,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
}
}
@Slow
@Nightly
public void testSortedSetAroundBlockSize() throws IOException {
final int frontier = 1 << Lucene70DocValuesFormat.DIRECT_MONOTONIC_BLOCK_SHIFT;
for (int maxDoc = frontier - 1; maxDoc <= frontier + 1; ++maxDoc) {
@ -499,7 +501,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
}
}
@Slow
@Nightly
public void testSortedNumericAroundBlockSize() throws IOException {
final int frontier = 1 << Lucene70DocValuesFormat.DIRECT_MONOTONIC_BLOCK_SHIFT;
for (int maxDoc = frontier - 1; maxDoc <= frontier + 1; ++maxDoc) {
@ -540,22 +542,22 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
}
}
@Slow
@Nightly
public void testSortedNumericBlocksOfVariousBitsPerValue() throws Exception {
doTestSortedNumericBlocksOfVariousBitsPerValue(() -> TestUtil.nextInt(random(), 1, 3));
}
@Slow
@Nightly
public void testSparseSortedNumericBlocksOfVariousBitsPerValue() throws Exception {
doTestSortedNumericBlocksOfVariousBitsPerValue(() -> TestUtil.nextInt(random(), 0, 2));
}
@Slow
@Nightly
public void testNumericBlocksOfVariousBitsPerValue() throws Exception {
doTestSparseNumericBlocksOfVariousBitsPerValue(1);
}
@Slow
@Nightly
public void testSparseNumericBlocksOfVariousBitsPerValue() throws Exception {
doTestSparseNumericBlocksOfVariousBitsPerValue(random().nextDouble());
}