You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2016/08/17 13:27:19 UTC

lucene-solr:branch_6x: LUCENE-7415: tone down some of the longest core tests

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 7c6ea8e1e -> 715db95af


LUCENE-7415: tone down some of the longest core tests


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/715db95a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/715db95a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/715db95a

Branch: refs/heads/branch_6x
Commit: 715db95af2c778c8b3aca39208936e0734adb40f
Parents: 7c6ea8e
Author: Robert Muir <rm...@apache.org>
Authored: Wed Aug 17 09:15:35 2016 -0400
Committer: Robert Muir <rm...@apache.org>
Committed: Wed Aug 17 09:16:26 2016 -0400

----------------------------------------------------------------------
 .../compressing/TestGrowableByteArrayDataOutput.java   |  2 +-
 .../src/test/org/apache/lucene/geo/TestGeoUtils.java   | 11 +++++++----
 .../src/test/org/apache/lucene/geo/TestPolygon2D.java  |  9 ++++++---
 .../test/org/apache/lucene/index/TestIndexSorting.java |  2 +-
 .../lucene/index/TestIndexingSequenceNumbers.java      |  4 ++++
 .../test/org/apache/lucene/search/TestBoolean2.java    | 13 +++++++++----
 .../search/TestSimpleExplanationsWithFillerDocs.java   |  2 ++
 7 files changed, 30 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/codecs/compressing/TestGrowableByteArrayDataOutput.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/compressing/TestGrowableByteArrayDataOutput.java b/lucene/core/src/test/org/apache/lucene/codecs/compressing/TestGrowableByteArrayDataOutput.java
index fb90d92..3820733 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/compressing/TestGrowableByteArrayDataOutput.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/compressing/TestGrowableByteArrayDataOutput.java
@@ -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];

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java b/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java
index e75ae85..2cfb2f8 100644
--- a/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java
+++ b/lucene/core/src/test/org/apache/lucene/geo/TestGeoUtils.java
@@ -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();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java b/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java
index 70281ca..31a42c0 100644
--- a/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java
+++ b/lucene/core/src/test/org/apache/lucene/geo/TestPolygon2D.java
@@ -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) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
index 96e53ab..3c457f3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
@@ -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<>();
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java
index 8d4c5c7..55aa6e0 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java
@@ -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);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java
index 0a217e3..d2925bd 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestBoolean2.java
@@ -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);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/715db95a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
index 0a79ae0..9f50668 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSimpleExplanationsWithFillerDocs.java
@@ -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 */