LUCENE-10168: Only test N-2 codecs on nightly runs. (#466)

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-24 08:20:04 +01:00 committed by GitHub
parent 6ee69e06fb
commit 24fcd80a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 86 additions and 585 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

@ -1,326 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.backward_codecs.lucene70;
import java.io.DataInput;
import java.io.IOException;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.BitSetIterator;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.RoaringDocIdSet;
/**
* Disk-based implementation of a {@link DocIdSetIterator} which can return the index of the current
* document, i.e. the ordinal of the current document among the list of documents that this iterator
* can return. This is useful to implement sparse doc values by only having to encode values for
* documents that actually have a value.
*
* <p>Implementation-wise, this {@link DocIdSetIterator} is inspired of {@link RoaringDocIdSet
* roaring bitmaps} and encodes ranges of {@code 65536} documents independently and picks between 3
* encodings depending on the density of the range:
*
* <ul>
* <li>{@code ALL} if the range contains 65536 documents exactly,
* <li>{@code DENSE} if the range contains 4096 documents or more; in that case documents are
* stored in a bit set,
* <li>{@code SPARSE} otherwise, and the lower 16 bits of the doc IDs are stored in a {@link
* DataInput#readShort() short}.
* </ul>
*
* <p>Only ranges that contain at least one value are encoded.
*
* <p>This implementation uses 6 bytes per document in the worst-case, which happens in the case
* that all ranges contain exactly one document.
*
* @lucene.internal
*/
final class IndexedDISI extends DocIdSetIterator {
static final int MAX_ARRAY_LENGTH = (1 << 12) - 1;
private static void flush(int block, FixedBitSet buffer, int cardinality, IndexOutput out)
throws IOException {
assert block >= 0 && block < 65536;
out.writeShort((short) block);
assert cardinality > 0 && cardinality <= 65536;
out.writeShort((short) (cardinality - 1));
if (cardinality > MAX_ARRAY_LENGTH) {
if (cardinality != 65536) { // all docs are set
for (long word : buffer.getBits()) {
out.writeLong(word);
}
}
} else {
BitSetIterator it = new BitSetIterator(buffer, cardinality);
for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
out.writeShort((short) doc);
}
}
}
static void writeBitSet(DocIdSetIterator it, IndexOutput out) throws IOException {
int i = 0;
final FixedBitSet buffer = new FixedBitSet(1 << 16);
int prevBlock = -1;
for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
final int block = doc >>> 16;
if (prevBlock != -1 && block != prevBlock) {
flush(prevBlock, buffer, i, out);
buffer.clear(0, buffer.length());
prevBlock = block;
i = 0;
}
buffer.set(doc & 0xFFFF);
i++;
prevBlock = block;
}
if (i > 0) {
flush(prevBlock, buffer, i, out);
buffer.clear(0, buffer.length());
}
// NO_MORE_DOCS is stored explicitly
buffer.set(DocIdSetIterator.NO_MORE_DOCS & 0xFFFF);
flush(DocIdSetIterator.NO_MORE_DOCS >>> 16, buffer, 1, out);
}
/** The slice that stores the {@link DocIdSetIterator}. */
private final IndexInput slice;
private final long cost;
IndexedDISI(IndexInput in, long offset, long length, long cost) throws IOException {
this(in.slice("docs", offset, length), cost);
}
// This constructor allows to pass the slice directly in case it helps reuse
// see eg. Lucene70 norms producer's merge instance
IndexedDISI(IndexInput slice, long cost) throws IOException {
this.slice = slice;
this.cost = cost;
}
private int block = -1;
private long blockEnd;
private int nextBlockIndex = -1;
Method method;
private int doc = -1;
private int index = -1;
// SPARSE variables
boolean exists;
// DENSE variables
private long word;
private int wordIndex = -1;
// number of one bits encountered so far, including those of `word`
private int numberOfOnes;
// ALL variables
private int gap;
@Override
public int docID() {
return doc;
}
@Override
public int advance(int target) throws IOException {
final int targetBlock = target & 0xFFFF0000;
if (block < targetBlock) {
advanceBlock(targetBlock);
}
if (block == targetBlock) {
if (method.advanceWithinBlock(this, target)) {
return doc;
}
readBlockHeader();
}
boolean found = method.advanceWithinBlock(this, block);
assert found;
return doc;
}
public boolean advanceExact(int target) throws IOException {
final int targetBlock = target & 0xFFFF0000;
if (block < targetBlock) {
advanceBlock(targetBlock);
}
boolean found = block == targetBlock && method.advanceExactWithinBlock(this, target);
this.doc = target;
return found;
}
private void advanceBlock(int targetBlock) throws IOException {
do {
slice.seek(blockEnd);
readBlockHeader();
} while (block < targetBlock);
}
private void readBlockHeader() throws IOException {
block = Short.toUnsignedInt(slice.readShort()) << 16;
assert block >= 0;
final int numValues = 1 + Short.toUnsignedInt(slice.readShort());
index = nextBlockIndex;
nextBlockIndex = index + numValues;
if (numValues <= MAX_ARRAY_LENGTH) {
method = Method.SPARSE;
blockEnd = slice.getFilePointer() + (numValues << 1);
} else if (numValues == 65536) {
method = Method.ALL;
blockEnd = slice.getFilePointer();
gap = block - index - 1;
} else {
method = Method.DENSE;
blockEnd = slice.getFilePointer() + (1 << 13);
wordIndex = -1;
numberOfOnes = index + 1;
}
}
@Override
public int nextDoc() throws IOException {
return advance(doc + 1);
}
public int index() {
return index;
}
@Override
public long cost() {
return cost;
}
enum Method {
SPARSE {
@Override
boolean advanceWithinBlock(IndexedDISI disi, int target) throws IOException {
final int targetInBlock = target & 0xFFFF;
// TODO: binary search
for (; disi.index < disi.nextBlockIndex; ) {
int doc = Short.toUnsignedInt(disi.slice.readShort());
disi.index++;
if (doc >= targetInBlock) {
disi.doc = disi.block | doc;
disi.exists = true;
return true;
}
}
return false;
}
@Override
boolean advanceExactWithinBlock(IndexedDISI disi, int target) throws IOException {
final int targetInBlock = target & 0xFFFF;
// TODO: binary search
if (target == disi.doc) {
return disi.exists;
}
for (; disi.index < disi.nextBlockIndex; ) {
int doc = Short.toUnsignedInt(disi.slice.readShort());
disi.index++;
if (doc >= targetInBlock) {
if (doc != targetInBlock) {
disi.index--;
disi.slice.seek(disi.slice.getFilePointer() - Short.BYTES);
break;
}
disi.exists = true;
return true;
}
}
disi.exists = false;
return false;
}
},
DENSE {
@Override
boolean advanceWithinBlock(IndexedDISI disi, int target) throws IOException {
final int targetInBlock = target & 0xFFFF;
final int targetWordIndex = targetInBlock >>> 6;
for (int i = disi.wordIndex + 1; i <= targetWordIndex; ++i) {
disi.word = disi.slice.readLong();
disi.numberOfOnes += Long.bitCount(disi.word);
}
disi.wordIndex = targetWordIndex;
long leftBits = disi.word >>> target;
if (leftBits != 0L) {
disi.doc = target + Long.numberOfTrailingZeros(leftBits);
disi.index = disi.numberOfOnes - Long.bitCount(leftBits);
return true;
}
while (++disi.wordIndex < 1024) {
disi.word = disi.slice.readLong();
if (disi.word != 0) {
disi.index = disi.numberOfOnes;
disi.numberOfOnes += Long.bitCount(disi.word);
disi.doc = disi.block | (disi.wordIndex << 6) | Long.numberOfTrailingZeros(disi.word);
return true;
}
}
return false;
}
@Override
boolean advanceExactWithinBlock(IndexedDISI disi, int target) throws IOException {
final int targetInBlock = target & 0xFFFF;
final int targetWordIndex = targetInBlock >>> 6;
for (int i = disi.wordIndex + 1; i <= targetWordIndex; ++i) {
disi.word = disi.slice.readLong();
disi.numberOfOnes += Long.bitCount(disi.word);
}
disi.wordIndex = targetWordIndex;
long leftBits = disi.word >>> target;
disi.index = disi.numberOfOnes - Long.bitCount(leftBits);
return (leftBits & 1L) != 0;
}
},
ALL {
@Override
boolean advanceWithinBlock(IndexedDISI disi, int target) throws IOException {
disi.doc = target;
disi.index = target - disi.gap;
return true;
}
@Override
boolean advanceExactWithinBlock(IndexedDISI disi, int target) throws IOException {
disi.index = target - disi.gap;
return true;
}
};
/**
* Advance to the first doc from the block that is equal to or greater than {@code target}.
* Return true if there is such a doc and false otherwise.
*/
abstract boolean advanceWithinBlock(IndexedDISI disi, int target) throws IOException;
/**
* Advance the iterator exactly to the position corresponding to the given {@code target} and
* return whether this document exists.
*/
abstract boolean advanceExactWithinBlock(IndexedDISI disi, int target) throws IOException;
}
}

View File

@ -39,9 +39,11 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
/** Tests BlockPostingsFormat */ /** Tests BlockPostingsFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestBlockPostingsFormat extends BasePostingsFormatTestCase { public class TestBlockPostingsFormat extends BasePostingsFormatTestCase {
private final Codec codec = TestUtil.alwaysPostingsFormat(new Lucene50RWPostingsFormat()); private final Codec codec = TestUtil.alwaysPostingsFormat(new Lucene50RWPostingsFormat());

View File

@ -29,9 +29,11 @@ import org.apache.lucene.index.IndexableField;
import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
/** Tests special cases of BlockPostingsFormat */ /** Tests special cases of BlockPostingsFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestBlockPostingsFormat2 extends LuceneTestCase { public class TestBlockPostingsFormat2 extends LuceneTestCase {
Directory dir; Directory dir;
RandomIndexWriter iw; RandomIndexWriter iw;

View File

@ -47,12 +47,14 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.English; import org.apache.lucene.util.English;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.automaton.AutomatonTestUtil; import org.apache.lucene.util.automaton.AutomatonTestUtil;
import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.CompiledAutomaton;
import org.apache.lucene.util.automaton.RegExp; import org.apache.lucene.util.automaton.RegExp;
/** Tests partial enumeration (only pulling a subset of the indexed data) */ /** Tests partial enumeration (only pulling a subset of the indexed data) */
@Nightly // N-2 formats are only tested on nightly runs
public class TestBlockPostingsFormat3 extends LuceneTestCase { public class TestBlockPostingsFormat3 extends LuceneTestCase {
private final int MAXDOC = private final int MAXDOC =
TEST_NIGHTLY ? Lucene50PostingsFormat.BLOCK_SIZE * 20 : Lucene50PostingsFormat.BLOCK_SIZE * 3; TEST_NIGHTLY ? Lucene50PostingsFormat.BLOCK_SIZE * 20 : Lucene50PostingsFormat.BLOCK_SIZE * 3;

View File

@ -30,8 +30,10 @@ import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.packed.PackedInts; import org.apache.lucene.util.packed.PackedInts;
@Nightly // N-2 formats are only tested on nightly runs
public class TestForUtil extends LuceneTestCase { public class TestForUtil extends LuceneTestCase {
public void testEncodeDecode() throws IOException { public void testEncodeDecode() throws IOException {

View File

@ -19,9 +19,10 @@ package org.apache.lucene.backward_codecs.lucene50;
import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseCompoundFormatTestCase; import org.apache.lucene.index.BaseCompoundFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene50CompoundFormat extends BaseCompoundFormatTestCase { public class TestLucene50CompoundFormat extends BaseCompoundFormatTestCase {
;
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -19,7 +19,9 @@ package org.apache.lucene.backward_codecs.lucene50;
import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec; import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseLiveDocsFormatTestCase; import org.apache.lucene.index.BaseLiveDocsFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene50LiveDocsFormat extends BaseLiveDocsFormatTestCase { public class TestLucene50LiveDocsFormat extends BaseLiveDocsFormatTestCase {
@Override @Override

View File

@ -19,7 +19,9 @@ package org.apache.lucene.backward_codecs.lucene50;
import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec; import org.apache.lucene.backward_codecs.lucene86.Lucene86RWCodec;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; import org.apache.lucene.index.BaseStoredFieldsFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene50StoredFieldsFormat extends BaseStoredFieldsFormatTestCase { public class TestLucene50StoredFieldsFormat extends BaseStoredFieldsFormatTestCase {
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -27,7 +27,9 @@ import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene50StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase { public class TestLucene50StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase {
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -16,7 +16,10 @@
*/ */
package org.apache.lucene.backward_codecs.lucene50; package org.apache.lucene.backward_codecs.lucene50;
import org.apache.lucene.util.LuceneTestCase.Nightly;
/** Test the merge instance of the Lucene50 stored fields format. */ /** Test the merge instance of the Lucene50 stored fields format. */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene50StoredFieldsFormatMergeInstance extends TestLucene50StoredFieldsFormat { public class TestLucene50StoredFieldsFormatMergeInstance extends TestLucene50StoredFieldsFormat {
@Override @Override

View File

@ -19,7 +19,9 @@ package org.apache.lucene.backward_codecs.lucene50;
import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec;
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.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene50TermVectorsFormat extends BaseTermVectorsFormatTestCase { public class TestLucene50TermVectorsFormat extends BaseTermVectorsFormatTestCase {
@Override @Override

View File

@ -19,7 +19,9 @@ package org.apache.lucene.backward_codecs.lucene60;
import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec; import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseFieldInfoFormatTestCase; import org.apache.lucene.index.BaseFieldInfoFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene60FieldInfosFormat extends BaseFieldInfoFormatTestCase { public class TestLucene60FieldInfosFormat extends BaseFieldInfoFormatTestCase {
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -33,10 +33,12 @@ import org.apache.lucene.index.PointValues;
import org.apache.lucene.index.PointValues.IntersectVisitor; import org.apache.lucene.index.PointValues.IntersectVisitor;
import org.apache.lucene.index.PointValues.Relation; import org.apache.lucene.index.PointValues.Relation;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.bkd.BKDConfig; import org.apache.lucene.util.bkd.BKDConfig;
/** Tests Lucene60PointsFormat */ /** Tests Lucene60PointsFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene60PointsFormat extends BasePointsFormatTestCase { public class TestLucene60PointsFormat extends BasePointsFormatTestCase {
private final Codec codec; private final Codec codec;
private final int maxPointsInLeafNode; private final int maxPointsInLeafNode;

View File

@ -1,252 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.backward_codecs.lucene70;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.backward_codecs.store.EndiannessReverserUtil;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.BitSetIterator;
import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
public class TestIndexedDISI extends LuceneTestCase {
public void testEmpty() throws IOException {
int maxDoc = TestUtil.nextInt(random(), 1, 100000);
FixedBitSet set = new FixedBitSet(maxDoc);
try (Directory dir = newDirectory()) {
doTest(set, dir);
}
}
public void testOneDoc() throws IOException {
int maxDoc = TestUtil.nextInt(random(), 1, 100000);
FixedBitSet set = new FixedBitSet(maxDoc);
set.set(random().nextInt(maxDoc));
try (Directory dir = newDirectory()) {
doTest(set, dir);
}
}
public void testTwoDocs() throws IOException {
int maxDoc = TestUtil.nextInt(random(), 1, 100000);
FixedBitSet set = new FixedBitSet(maxDoc);
set.set(random().nextInt(maxDoc));
set.set(random().nextInt(maxDoc));
try (Directory dir = newDirectory()) {
doTest(set, dir);
}
}
public void testAllDocs() throws IOException {
int maxDoc = TestUtil.nextInt(random(), 1, 100000);
FixedBitSet set = new FixedBitSet(maxDoc);
set.set(1, maxDoc);
try (Directory dir = newDirectory()) {
doTest(set, dir);
}
}
public void testHalfFull() throws IOException {
int maxDoc = TestUtil.nextInt(random(), 1, 100000);
FixedBitSet set = new FixedBitSet(maxDoc);
for (int i = random().nextInt(2); i < maxDoc; i += TestUtil.nextInt(random(), 1, 3)) {
set.set(i);
}
try (Directory dir = newDirectory()) {
doTest(set, dir);
}
}
public void testDocRange() throws IOException {
try (Directory dir = newDirectory()) {
for (int iter = 0; iter < 10; ++iter) {
int maxDoc = TestUtil.nextInt(random(), 1, 1000000);
FixedBitSet set = new FixedBitSet(maxDoc);
final int start = random().nextInt(maxDoc);
final int end = TestUtil.nextInt(random(), start + 1, maxDoc);
set.set(start, end);
doTest(set, dir);
}
}
}
public void testSparseDenseBoundary() throws IOException {
try (Directory dir = newDirectory()) {
FixedBitSet set = new FixedBitSet(200000);
int start = 65536 + random().nextInt(100);
// we set MAX_ARRAY_LENGTH bits so the encoding will be sparse
set.set(start, start + IndexedDISI.MAX_ARRAY_LENGTH);
long length;
try (IndexOutput out =
EndiannessReverserUtil.createOutput(dir, "sparse", IOContext.DEFAULT)) {
IndexedDISI.writeBitSet(new BitSetIterator(set, IndexedDISI.MAX_ARRAY_LENGTH), out);
length = out.getFilePointer();
}
try (IndexInput in = EndiannessReverserUtil.openInput(dir, "sparse", IOContext.DEFAULT)) {
IndexedDISI disi = new IndexedDISI(in, 0L, length, IndexedDISI.MAX_ARRAY_LENGTH);
assertEquals(start, disi.nextDoc());
assertEquals(IndexedDISI.Method.SPARSE, disi.method);
}
doTest(set, dir);
// now we set one more bit so the encoding will be dense
set.set(start + IndexedDISI.MAX_ARRAY_LENGTH + random().nextInt(100));
try (IndexOutput out = EndiannessReverserUtil.createOutput(dir, "bar", IOContext.DEFAULT)) {
IndexedDISI.writeBitSet(new BitSetIterator(set, IndexedDISI.MAX_ARRAY_LENGTH + 1), out);
length = out.getFilePointer();
}
try (IndexInput in = EndiannessReverserUtil.openInput(dir, "bar", IOContext.DEFAULT)) {
IndexedDISI disi = new IndexedDISI(in, 0L, length, IndexedDISI.MAX_ARRAY_LENGTH + 1);
assertEquals(start, disi.nextDoc());
assertEquals(IndexedDISI.Method.DENSE, disi.method);
}
doTest(set, dir);
}
}
public void testOneDocMissing() throws IOException {
int maxDoc = TestUtil.nextInt(random(), 1, 1000000);
FixedBitSet set = new FixedBitSet(maxDoc);
set.set(0, maxDoc);
set.clear(random().nextInt(maxDoc));
try (Directory dir = newDirectory()) {
doTest(set, dir);
}
}
public void testFewMissingDocs() throws IOException {
try (Directory dir = newDirectory()) {
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);
final int numMissingDocs = TestUtil.nextInt(random(), 2, 1000);
for (int i = 0; i < numMissingDocs; ++i) {
set.clear(random().nextInt(maxDoc));
}
doTest(set, dir);
}
}
}
public void testRandom() throws IOException {
try (Directory dir = newDirectory()) {
int numIters = atLeast(3);
for (int i = 0; i < numIters; ++i) {
doTestRandom(dir);
}
}
}
private void doTestRandom(Directory dir) throws IOException {
List<Integer> docs = new ArrayList<>();
final int maxStep = TestUtil.nextInt(random(), 1, 1 << TestUtil.nextInt(random(), 2, 20));
final int numDocs =
TestUtil.nextInt(random(), 1, Math.min(100000, Integer.MAX_VALUE / maxStep));
for (int doc = -1, i = 0; i < numDocs; ++i) {
doc += TestUtil.nextInt(random(), 1, maxStep);
docs.add(doc);
}
final int maxDoc = docs.get(docs.size() - 1) + TestUtil.nextInt(random(), 1, 100);
FixedBitSet set = new FixedBitSet(maxDoc);
for (int doc : docs) {
set.set(doc);
}
doTest(set, dir);
}
private void doTest(FixedBitSet set, Directory dir) throws IOException {
final int cardinality = set.cardinality();
long length;
try (IndexOutput out = EndiannessReverserUtil.createOutput(dir, "foo", IOContext.DEFAULT)) {
IndexedDISI.writeBitSet(new BitSetIterator(set, cardinality), out);
length = out.getFilePointer();
}
try (IndexInput in = EndiannessReverserUtil.openInput(dir, "foo", IOContext.DEFAULT)) {
IndexedDISI disi = new IndexedDISI(in, 0L, length, cardinality);
BitSetIterator disi2 = new BitSetIterator(set, cardinality);
int i = 0;
for (int doc = disi2.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = disi2.nextDoc()) {
assertEquals(doc, disi.nextDoc());
assertEquals(i++, disi.index());
}
assertEquals(DocIdSetIterator.NO_MORE_DOCS, disi.nextDoc());
}
for (int step : new int[] {1, 10, 100, 1000, 10000, 100000}) {
try (IndexInput in = EndiannessReverserUtil.openInput(dir, "foo", IOContext.DEFAULT)) {
IndexedDISI disi = new IndexedDISI(in, 0L, length, cardinality);
BitSetIterator disi2 = new BitSetIterator(set, cardinality);
int index = -1;
while (true) {
int target = disi2.docID() + step;
int doc;
do {
doc = disi2.nextDoc();
index++;
} while (doc < target);
assertEquals(doc, disi.advance(target));
if (doc == DocIdSetIterator.NO_MORE_DOCS) {
break;
}
assertEquals(index, disi.index());
}
}
}
for (int step : new int[] {10, 100, 1000, 10000, 100000}) {
try (IndexInput in = EndiannessReverserUtil.openInput(dir, "foo", IOContext.DEFAULT)) {
IndexedDISI disi = new IndexedDISI(in, 0L, length, cardinality);
BitSetIterator disi2 = new BitSetIterator(set, cardinality);
int index = -1;
for (int target = 0; target < set.length(); ) {
target += TestUtil.nextInt(random(), 0, step);
int doc = disi2.docID();
while (doc < target) {
doc = disi2.nextDoc();
index++;
}
boolean exists = disi.advanceExact(target);
assertEquals(doc == target, exists);
if (exists) {
assertEquals(index, disi.index());
} else if (random().nextBoolean()) {
assertEquals(doc, disi.nextDoc());
assertEquals(index, disi.index());
target = doc;
}
}
}
}
dir.deleteFile("foo");
}
}

View File

@ -20,8 +20,10 @@ package org.apache.lucene.backward_codecs.lucene70;
import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec; import org.apache.lucene.backward_codecs.lucene84.Lucene84RWCodec;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseSegmentInfoFormatTestCase; import org.apache.lucene.index.BaseSegmentInfoFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.Version; import org.apache.lucene.util.Version;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70SegmentInfoFormat extends BaseSegmentInfoFormatTestCase { public class TestLucene70SegmentInfoFormat extends BaseSegmentInfoFormatTestCase {
@Override @Override

View File

@ -17,9 +17,11 @@
package org.apache.lucene.backward_codecs.lucene80; package org.apache.lucene.backward_codecs.lucene80;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
/** Tests Lucene80DocValuesFormat */ /** Tests Lucene80DocValuesFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestBestCompressionLucene80DocValuesFormat public class TestBestCompressionLucene80DocValuesFormat
extends BaseLucene80DocValuesFormatTestCase { extends BaseLucene80DocValuesFormatTestCase {
private final Codec codec = private final Codec codec =

View File

@ -17,9 +17,11 @@
package org.apache.lucene.backward_codecs.lucene80; package org.apache.lucene.backward_codecs.lucene80;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
/** Tests Lucene80DocValuesFormat */ /** Tests Lucene80DocValuesFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestBestSpeedLucene80DocValuesFormat extends BaseLucene80DocValuesFormatTestCase { public class TestBestSpeedLucene80DocValuesFormat extends BaseLucene80DocValuesFormatTestCase {
private final Codec codec = private final Codec codec =
TestUtil.alwaysDocValuesFormat( TestUtil.alwaysDocValuesFormat(

View File

@ -39,8 +39,10 @@ import org.apache.lucene.index.SortedSetDocValues;
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.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
@Nightly // N-2 formats are only tested on nightly runs
public class TestDocValuesCompression extends LuceneTestCase { public class TestDocValuesCompression extends LuceneTestCase {
private final Codec bestSpeed = private final Codec bestSpeed =
TestUtil.alwaysDocValuesFormat( TestUtil.alwaysDocValuesFormat(

View File

@ -29,9 +29,11 @@ import org.apache.lucene.util.BitSet;
import org.apache.lucene.util.BitSetIterator; import org.apache.lucene.util.BitSetIterator;
import org.apache.lucene.util.FixedBitSet; import org.apache.lucene.util.FixedBitSet;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.SparseFixedBitSet; import org.apache.lucene.util.SparseFixedBitSet;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
@Nightly // N-2 formats are only tested on nightly runs
public class TestIndexedDISI extends LuceneTestCase { public class TestIndexedDISI extends LuceneTestCase {
public void testEmpty() throws IOException { public void testEmpty() throws IOException {

View File

@ -19,8 +19,10 @@ package org.apache.lucene.backward_codecs.lucene80;
import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec;
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 Lucene80NormsFormat */ /** Tests Lucene80NormsFormat */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene80NormsFormat extends BaseNormsFormatTestCase { public class TestLucene80NormsFormat extends BaseNormsFormatTestCase {
private final Codec codec = new Lucene87RWCodec(); private final Codec codec = new Lucene87RWCodec();

View File

@ -16,7 +16,10 @@
*/ */
package org.apache.lucene.backward_codecs.lucene80; package org.apache.lucene.backward_codecs.lucene80;
import org.apache.lucene.util.LuceneTestCase.Nightly;
/** Test the merge instance of the Lucene80 norms format. */ /** Test the merge instance of the Lucene80 norms format. */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene80NormsFormatMergeInstance extends TestLucene80NormsFormat { public class TestLucene80NormsFormatMergeInstance extends TestLucene80NormsFormat {
@Override @Override

View File

@ -26,9 +26,11 @@ import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.packed.PackedInts; import org.apache.lucene.util.packed.PackedInts;
@Nightly // N-2 formats are only tested on nightly runs
public class TestForDeltaUtil extends LuceneTestCase { public class TestForDeltaUtil extends LuceneTestCase {
public void testEncodeDecode() throws IOException { public void testEncodeDecode() throws IOException {

View File

@ -27,9 +27,11 @@ import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.packed.PackedInts; import org.apache.lucene.util.packed.PackedInts;
@Nightly // N-2 formats are only tested on nightly runs
public class TestForUtil extends LuceneTestCase { public class TestForUtil extends LuceneTestCase {
public void testEncodeDecode() throws IOException { public void testEncodeDecode() throws IOException {

View File

@ -39,8 +39,10 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene84PostingsFormat extends BasePostingsFormatTestCase { public class TestLucene84PostingsFormat extends BasePostingsFormatTestCase {
private final Codec codec = TestUtil.alwaysPostingsFormat(new Lucene84RWPostingsFormat()); private final Codec codec = TestUtil.alwaysPostingsFormat(new Lucene84RWPostingsFormat());

View File

@ -27,9 +27,11 @@ import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.packed.PackedInts; import org.apache.lucene.util.packed.PackedInts;
@Nightly // N-2 formats are only tested on nightly runs
public class TestPForUtil extends LuceneTestCase { public class TestPForUtil extends LuceneTestCase {
public void testEncodeDecode() throws IOException { public void testEncodeDecode() throws IOException {

View File

@ -39,9 +39,11 @@ import org.apache.lucene.index.PointValues.Relation;
import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentReadState;
import org.apache.lucene.index.SegmentWriteState; import org.apache.lucene.index.SegmentWriteState;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.bkd.BKDConfig; import org.apache.lucene.util.bkd.BKDConfig;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene86PointsFormat extends BasePointsFormatTestCase { public class TestLucene86PointsFormat extends BasePointsFormatTestCase {
private final Codec codec; private final Codec codec;

View File

@ -20,9 +20,10 @@ package org.apache.lucene.backward_codecs.lucene86;
import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec; import org.apache.lucene.backward_codecs.lucene87.Lucene87RWCodec;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseSegmentInfoFormatTestCase; import org.apache.lucene.index.BaseSegmentInfoFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.Version; import org.apache.lucene.util.Version;
@SuppressWarnings("deprecation") @Nightly // N-2 formats are only tested on nightly runs
public class TestLucene86SegmentInfoFormat extends BaseSegmentInfoFormatTestCase { public class TestLucene86SegmentInfoFormat extends BaseSegmentInfoFormatTestCase {
@Override @Override

View File

@ -18,7 +18,9 @@ package org.apache.lucene.backward_codecs.lucene87;
import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; import org.apache.lucene.index.BaseStoredFieldsFormatTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene87StoredFieldsFormat extends BaseStoredFieldsFormatTestCase { public class TestLucene87StoredFieldsFormat extends BaseStoredFieldsFormatTestCase {
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -25,7 +25,9 @@ import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene87StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase { public class TestLucene87StoredFieldsFormatHighCompression extends BaseStoredFieldsFormatTestCase {
@Override @Override
protected Codec getCodec() { protected Codec getCodec() {

View File

@ -16,7 +16,10 @@
*/ */
package org.apache.lucene.backward_codecs.lucene87; package org.apache.lucene.backward_codecs.lucene87;
import org.apache.lucene.util.LuceneTestCase.Nightly;
/** Test the merge instance of the Lucene87 stored fields format. */ /** Test the merge instance of the Lucene87 stored fields format. */
@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene87StoredFieldsFormatMergeInstance extends TestLucene87StoredFieldsFormat { public class TestLucene87StoredFieldsFormatMergeInstance extends TestLucene87StoredFieldsFormat {
@Override @Override

View File

@ -29,8 +29,10 @@ import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.LongValues; import org.apache.lucene.util.LongValues;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLegacyDirectMonotonic extends LuceneTestCase { public class TestLegacyDirectMonotonic extends LuceneTestCase {
public void testValidation() { public void testValidation() {

View File

@ -25,8 +25,10 @@ import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LongValues; import org.apache.lucene.util.LongValues;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLegacyDirectPacked extends LuceneTestCase { public class TestLegacyDirectPacked extends LuceneTestCase {
/** simple encode/decode */ /** simple encode/decode */

View File

@ -23,11 +23,13 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.RamUsageTester; import org.apache.lucene.util.RamUsageTester;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.packed.PackedInts; import org.apache.lucene.util.packed.PackedInts;
import org.apache.lucene.util.packed.PackedInts.Reader; import org.apache.lucene.util.packed.PackedInts.Reader;
@Nightly // N-2 formats are only tested on nightly runs
public class TestLegacyPackedInts extends LuceneTestCase { public class TestLegacyPackedInts extends LuceneTestCase {
public void testPackedInts() throws IOException { public void testPackedInts() throws IOException {

View File

@ -23,7 +23,9 @@ import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.RandomAccessInput; import org.apache.lucene.store.RandomAccessInput;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public abstract class EndiannessReverserTestCase extends LuceneTestCase { public abstract class EndiannessReverserTestCase extends LuceneTestCase {
protected abstract IndexInput getEndiannessReverserInput( protected abstract IndexInput getEndiannessReverserInput(

View File

@ -21,7 +21,9 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestEndiannessReverserCheckSumIndexInput extends EndiannessReverserTestCase { public class TestEndiannessReverserCheckSumIndexInput extends EndiannessReverserTestCase {
@Override @Override

View File

@ -21,7 +21,9 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.util.LuceneTestCase.Nightly;
@Nightly // N-2 formats are only tested on nightly runs
public class TestEndiannessReverserIndexInput extends EndiannessReverserTestCase { public class TestEndiannessReverserIndexInput extends EndiannessReverserTestCase {
@Override @Override

View File

@ -1015,6 +1015,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR); searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR);
} }
if (TEST_NIGHTLY) {
for (String name : binarySupportedNames) { for (String name : binarySupportedNames) {
Path oldIndexDir = createTempDir(name); Path oldIndexDir = createTempDir(name);
TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir); TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
@ -1023,6 +1024,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
} }
} }
} }
}
public void testIndexOldIndexNoAdds() throws IOException { public void testIndexOldIndexNoAdds() throws IOException {
for (String name : oldNames) { for (String name : oldNames) {
@ -2080,6 +2082,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));