LUCENE-10168: Only test N-2 codecs on nightly runs.

In order for tests to keep running fast, this annotates all tests of N-2 codecs
with `@Nightly`. To keep good coverage of releases, the smoke tester is now
configured to run nightly tests.
This commit is contained in:
Adrien Grand 2021-11-23 09:12:59 +01:00
parent 170137129a
commit 3f634e2ab9
5 changed files with 19 additions and 5 deletions

View File

@ -1129,6 +1129,12 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
# disable flakey tests for smoke-tester runs:
testArgs = '-Dtests.badapples=false %s' % testArgs
# Tests annotated @Nightly are more resource-intensive but often cover
# important code paths. They're disabled by default to preserve a good
# developer experience, but we enable them for smoke tests where we want good
# coverage.
testArgs = '-Dtests.nigthly=true %s' % testArgs
if FORCE_CLEAN:
if os.path.exists(tmpDir):
raise RuntimeError('temp dir %s exists; please remove first' % tmpDir)

View File

@ -66,9 +66,11 @@ import org.apache.lucene.store.ByteBuffersDataOutput;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil;
/** Tests Lucene70DocValuesFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatTestCase {
private final Codec codec = TestUtil.alwaysDocValuesFormat(new Lucene70DocValuesFormat());

View File

@ -18,8 +18,10 @@ package org.apache.lucene.backward_codecs.lucene70;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseNormsFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
/** Tests Lucene70NormsFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70NormsFormat extends BaseNormsFormatTestCase {
@Override
protected Codec getCodec() {

View File

@ -1037,11 +1037,13 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR);
}
for (String name : binarySupportedNames) {
Path oldIndexDir = createTempDir(name);
TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) {
searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR);
if (TEST_NIGHTLY) {
for (String name : binarySupportedNames) {
Path oldIndexDir = createTempDir(name);
TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) {
searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR);
}
}
}
}
@ -2096,6 +2098,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
}
}
@Nightly
public void testReadNMinusTwoCommit() throws IOException {
for (String name : binarySupportedNames) {
Path oldIndexDir = createTempDir(name);

View File

@ -165,6 +165,7 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
}
// LUCENE-5724: actually test we play nice with NRTCachingDir and massive file
@Slow
public void testLargeCFS() throws IOException {
final String testfile = "_123.test";
IOContext context = new IOContext(new FlushInfo(0, 512 * 1024 * 1024));