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: # disable flakey tests for smoke-tester runs:
testArgs = '-Dtests.badapples=false %s' % testArgs 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 FORCE_CLEAN:
if os.path.exists(tmpDir): if os.path.exists(tmpDir):
raise RuntimeError('temp dir %s exists; please remove first' % 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.store.Directory;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
/** Tests Lucene70DocValuesFormat */ /** Tests Lucene70DocValuesFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatTestCase { public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatTestCase {
private final Codec codec = TestUtil.alwaysDocValuesFormat(new Lucene70DocValuesFormat()); 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.codecs.Codec;
import org.apache.lucene.index.BaseNormsFormatTestCase; import org.apache.lucene.index.BaseNormsFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
/** Tests Lucene70NormsFormat */ /** Tests Lucene70NormsFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70NormsFormat extends BaseNormsFormatTestCase { public class TestLucene70NormsFormat extends BaseNormsFormatTestCase {
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -1037,11 +1037,13 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR); searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR);
} }
for (String name : binarySupportedNames) { if (TEST_NIGHTLY) {
Path oldIndexDir = createTempDir(name); for (String name : binarySupportedNames) {
TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir); Path oldIndexDir = createTempDir(name);
try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) { TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR); 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 { public void testReadNMinusTwoCommit() throws IOException {
for (String name : binarySupportedNames) { for (String name : binarySupportedNames) {
Path oldIndexDir = createTempDir(name); 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 // LUCENE-5724: actually test we play nice with NRTCachingDir and massive file
@Slow
public void testLargeCFS() throws IOException { public void testLargeCFS() throws IOException {
final String testfile = "_123.test"; final String testfile = "_123.test";
IOContext context = new IOContext(new FlushInfo(0, 512 * 1024 * 1024)); IOContext context = new IOContext(new FlushInfo(0, 512 * 1024 * 1024));