mirror of https://github.com/apache/lucene.git
LUCENE-7415: tone down some of the longest core tests
This commit is contained in:
parent
7c6ea8e1e8
commit
715db95af2
|
@ -58,7 +58,7 @@ public class TestGrowableByteArrayDataOutput extends LuceneTestCase {
|
|||
public void testWriteLargeStrings() throws Exception {
|
||||
int minSizeForDoublePass = GrowableByteArrayDataOutput.MIN_UTF8_SIZE_TO_ENABLE_DOUBLE_PASS_ENCODING;
|
||||
|
||||
int num = atLeast(1000);
|
||||
int num = atLeast(100);
|
||||
for (int i = 0; i < num; i++) {
|
||||
String unicode = TestUtil.randomRealisticUnicodeString(random(), minSizeForDoublePass, 10 * minSizeForDoublePass);
|
||||
byte[] utf8 = new byte[unicode.length() * UnicodeUtil.MAX_UTF8_BYTES_PER_CHAR];
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TestGeoUtils extends LuceneTestCase {
|
|||
|
||||
// We rely heavily on GeoUtils.circleToBBox so we test it here:
|
||||
public void testRandomCircleToBBox() throws Exception {
|
||||
int iters = atLeast(1000);
|
||||
int iters = atLeast(100);
|
||||
for(int iter=0;iter<iters;iter++) {
|
||||
|
||||
double centerLat = GeoTestUtil.nextLatitude();
|
||||
|
@ -89,7 +89,8 @@ public class TestGeoUtils extends LuceneTestCase {
|
|||
|
||||
// similar to testRandomCircleToBBox, but different, less evil, maybe simpler
|
||||
public void testBoundingBoxOpto() {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
int iters = atLeast(100);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
double lat = GeoTestUtil.nextLatitude();
|
||||
double lon = GeoTestUtil.nextLongitude();
|
||||
double radius = 50000000 * random().nextDouble();
|
||||
|
@ -119,7 +120,8 @@ public class TestGeoUtils extends LuceneTestCase {
|
|||
|
||||
// test we can use haversinSortKey() for distance queries.
|
||||
public void testHaversinOpto() {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
int iters = atLeast(100);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
double lat = GeoTestUtil.nextLatitude();
|
||||
double lon = GeoTestUtil.nextLongitude();
|
||||
double radius = 50000000 * random().nextDouble();
|
||||
|
@ -193,7 +195,8 @@ public class TestGeoUtils extends LuceneTestCase {
|
|||
// TODO: does not really belong here, but we test it like this for now
|
||||
// we can make a fake IndexReader to send boxes directly to Point visitors instead?
|
||||
public void testCircleOpto() throws Exception {
|
||||
for (int i = 0; i < 50; i++) {
|
||||
int iters = atLeast(20);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
// circle
|
||||
final double centerLat = -90 + 180.0 * random().nextDouble();
|
||||
final double centerLon = -180 + 360.0 * random().nextDouble();
|
||||
|
|
|
@ -103,7 +103,8 @@ public class TestPolygon2D extends LuceneTestCase {
|
|||
|
||||
/** If polygon.contains(box) returns true, then any point in that box should return true as well */
|
||||
public void testContainsRandom() throws Exception {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
int iters = atLeast(50);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
Polygon polygon = nextPolygon();
|
||||
Polygon2D impl = Polygon2D.create(polygon);
|
||||
|
||||
|
@ -175,7 +176,8 @@ public class TestPolygon2D extends LuceneTestCase {
|
|||
|
||||
/** If polygon.intersects(box) returns false, then any point in that box should return false as well */
|
||||
public void testIntersectRandom() {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
int iters = atLeast(10);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
Polygon polygon = nextPolygon();
|
||||
Polygon2D impl = Polygon2D.create(polygon);
|
||||
|
||||
|
@ -268,7 +270,8 @@ public class TestPolygon2D extends LuceneTestCase {
|
|||
|
||||
/** Tests current impl against original algorithm */
|
||||
public void testContainsAgainstOriginal() {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
int iters = atLeast(100);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
Polygon polygon = nextPolygon();
|
||||
// currently we don't generate these, but this test does not want holes.
|
||||
while (polygon.getHoles().length > 0) {
|
||||
|
|
|
@ -1217,7 +1217,7 @@ public class TestIndexSorting extends LuceneTestCase {
|
|||
if (TEST_NIGHTLY) {
|
||||
numDocs = atLeast(100000);
|
||||
} else {
|
||||
numDocs = atLeast(10000);
|
||||
numDocs = atLeast(1000);
|
||||
}
|
||||
List<RandomDoc> docs = new ArrayList<>();
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ public class TestIndexingSequenceNumbers extends LuceneTestCase {
|
|||
dir.close();
|
||||
}
|
||||
|
||||
@Slow
|
||||
public void testStressUpdateSameID() throws Exception {
|
||||
int iters = atLeast(100);
|
||||
for(int iter=0;iter<iters;iter++) {
|
||||
|
@ -144,6 +145,7 @@ public class TestIndexingSequenceNumbers extends LuceneTestCase {
|
|||
long seqNo;
|
||||
}
|
||||
|
||||
@Slow
|
||||
public void testStressConcurrentCommit() throws Exception {
|
||||
final int opCount = atLeast(10000);
|
||||
final int idCount = TestUtil.nextInt(random(), 10, 1000);
|
||||
|
@ -303,6 +305,7 @@ public class TestIndexingSequenceNumbers extends LuceneTestCase {
|
|||
dir.close();
|
||||
}
|
||||
|
||||
@Slow
|
||||
public void testStressConcurrentDocValuesUpdatesCommit() throws Exception {
|
||||
final int opCount = atLeast(10000);
|
||||
final int idCount = TestUtil.nextInt(random(), 10, 1000);
|
||||
|
@ -459,6 +462,7 @@ public class TestIndexingSequenceNumbers extends LuceneTestCase {
|
|||
dir.close();
|
||||
}
|
||||
|
||||
@Slow
|
||||
public void testStressConcurrentAddAndDeleteAndCommit() throws Exception {
|
||||
final int opCount = atLeast(10000);
|
||||
final int idCount = TestUtil.nextInt(random(), 10, 1000);
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.Random;
|
|||
import org.apache.lucene.analysis.MockAnalyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.FieldType;
|
||||
import org.apache.lucene.document.TextField;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
|
@ -67,7 +69,7 @@ public class TestBoolean2 extends LuceneTestCase {
|
|||
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws Exception {
|
||||
// in some runs, test immediate adjacency of matches - in others, force a full bucket gap betwen docs
|
||||
// in some runs, test immediate adjacency of matches - in others, force a full bucket gap between docs
|
||||
NUM_FILLER_DOCS = random().nextBoolean() ? 0 : BooleanScorer.SIZE;
|
||||
PRE_FILLER_DOCS = TestUtil.nextInt(random(), 0, (NUM_FILLER_DOCS / 2));
|
||||
|
||||
|
@ -78,13 +80,16 @@ public class TestBoolean2 extends LuceneTestCase {
|
|||
}
|
||||
|
||||
RandomIndexWriter writer= new RandomIndexWriter(random(), directory, newIndexWriterConfig(new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
|
||||
// we'll make a ton of docs, disable store/norms/vectors
|
||||
FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
|
||||
ft.setOmitNorms(true);
|
||||
|
||||
Document doc = new Document();
|
||||
for (int filler = 0; filler < PRE_FILLER_DOCS; filler++) {
|
||||
writer.addDocument(doc);
|
||||
}
|
||||
for (int i = 0; i < docFields.length; i++) {
|
||||
doc.add(newTextField(field, docFields[i], Field.Store.NO));
|
||||
doc.add(new Field(field, docFields[i], ft));
|
||||
writer.addDocument(doc);
|
||||
|
||||
doc = new Document();
|
||||
|
@ -149,12 +154,12 @@ public class TestBoolean2 extends LuceneTestCase {
|
|||
newIndexWriterConfig(new MockAnalyzer(random()))
|
||||
.setMaxBufferedDocs(TestUtil.nextInt(random(), 50, 1000)));
|
||||
doc = new Document();
|
||||
doc.add(newTextField("field2", "xxx", Field.Store.NO));
|
||||
doc.add(new Field("field2", "xxx", ft));
|
||||
for(int i=0;i<NUM_EXTRA_DOCS/2;i++) {
|
||||
w.addDocument(doc);
|
||||
}
|
||||
doc = new Document();
|
||||
doc.add(newTextField("field2", "big bad bug", Field.Store.NO));
|
||||
doc.add(new Field("field2", "big bad bug", ft));
|
||||
for(int i=0;i<NUM_EXTRA_DOCS/2;i++) {
|
||||
w.addDocument(doc);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.apache.lucene.document.Field;
|
|||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.index.RandomIndexWriter;
|
||||
import org.apache.lucene.util.TestUtil;
|
||||
import org.apache.lucene.util.LuceneTestCase.Slow;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Assume;
|
||||
|
@ -34,6 +35,7 @@ import org.junit.Assume;
|
|||
* all use terms from same set of source data as our regular docs (to emphasis the DocFreq factor in scoring),
|
||||
* in which case the queries will be wrapped so they can be excluded.
|
||||
*/
|
||||
@Slow // can this be sped up to be non-slow? filler docs make it quite a bit slower and many test methods...
|
||||
public class TestSimpleExplanationsWithFillerDocs extends TestSimpleExplanations {
|
||||
|
||||
/** num of empty docs injected between every doc in the index */
|
||||
|
|
Loading…
Reference in New Issue