#12932: get monsters tests compiling/running again (#12942)

This commit is contained in:
Michael McCandless 2023-12-14 10:12:15 -05:00 committed by Mike McCandless
parent b0ebb849f5
commit d1551da027
5 changed files with 8 additions and 9 deletions

View File

@ -23,7 +23,6 @@ import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ExecutorService;
@ -75,7 +74,7 @@ public final class Test20NewsgroupsClassification extends LuceneTestCase {
private static final String CATEGORY_FIELD = "category";
private static final String BODY_FIELD = "body";
private static final String SUBJECT_FIELD = "subject";
private static final String INDEX_DIR = "/path/to/lucene-solr/lucene/classification/20n";
// private static final String INDEX_DIR = "/path/to/lucene-solr/lucene/classification/20n";
private static boolean index = true;
private static boolean split = true;
@ -127,7 +126,7 @@ public final class Test20NewsgroupsClassification extends LuceneTestCase {
long startIndex = System.nanoTime();
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(analyzer));
Path indexDir = Paths.get(INDEX_DIR);
Path indexDir = createTempDir("Test20NewsgroupsClassification");
int docsIndexed = buildIndex(indexDir, indexWriter);
long endIndex = System.nanoTime();

View File

@ -143,6 +143,6 @@ public class Test2BPoints extends LuceneTestCase {
}
private static Codec getCodec() {
return Codec.forName("Lucene84");
return Codec.getDefault();
}
}

View File

@ -82,12 +82,12 @@ public class Test2BSortedDocValuesFixedSorted extends LuceneTestCase {
int expectedValue = 0;
for (LeafReaderContext context : r.leaves()) {
LeafReader reader = context.reader();
BinaryDocValues dv = DocValues.getBinary(reader, "dv");
SortedDocValues dv = DocValues.getSorted(reader, "dv");
for (int i = 0; i < reader.maxDoc(); i++) {
assertEquals(i, dv.nextDoc());
bytes[0] = (byte) (expectedValue >> 8);
bytes[1] = (byte) expectedValue;
final BytesRef term = dv.binaryValue();
final BytesRef term = dv.lookupOrd(dv.ordValue());
assertEquals(data, term);
expectedValue++;
}

View File

@ -84,7 +84,7 @@ public class Test2BSortedDocValuesOrds extends LuceneTestCase {
int counter = 0;
for (LeafReaderContext context : r.leaves()) {
LeafReader reader = context.reader();
BinaryDocValues dv = DocValues.getBinary(reader, "dv");
SortedDocValues dv = DocValues.getSorted(reader, "dv");
for (int i = 0; i < reader.maxDoc(); i++) {
assertEquals(i, dv.nextDoc());
bytes[0] = (byte) (counter >> 24);
@ -92,7 +92,7 @@ public class Test2BSortedDocValuesOrds extends LuceneTestCase {
bytes[2] = (byte) (counter >> 8);
bytes[3] = (byte) counter;
counter++;
final BytesRef term = dv.binaryValue();
final BytesRef term = dv.lookupOrd(dv.ordValue());
assertEquals(data, term);
}
}

View File

@ -39,7 +39,7 @@ import org.apache.lucene.tests.util.TestUtil;
import org.apache.lucene.tests.util.TimeUnits;
@SuppressCodecs({"SimpleText", "Direct"})
@TimeoutSuite(millis = 8 * TimeUnits.HOUR)
@TimeoutSuite(millis = 24 * TimeUnits.HOUR)
public class TestIndexWriterMaxDocs extends LuceneTestCase {
// The two hour time was achieved on a Linux 3.13 system with these specs: