You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2017/07/13 07:18:25 UTC

[17/41] lucene-solr:feature/autoscaling: SOLR-10796: try again to fix failing stats tests: fix hard-coded assertions to depend on doc count where it's affected by the random multiplier.

SOLR-10796: try again to fix failing stats tests: fix hard-coded assertions to depend on doc count where it's affected by the random multiplier.


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

Branch: refs/heads/feature/autoscaling
Commit: 8a3ca50c1a11aabcdd17ccdf634028bff76d8f2a
Parents: ce949aa
Author: Steve Rowe <sa...@apache.org>
Authored: Tue Jul 11 15:02:03 2017 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Tue Jul 11 15:02:49 2017 -0400

----------------------------------------------------------------------
 .../src/test/org/apache/solr/schema/TestPointFields.java    | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8a3ca50c/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestPointFields.java b/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
index 0ea0157..b6e00b2 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
@@ -1185,7 +1185,7 @@ public class TestPointFields extends SolrTestCaseJ4 {
     do {
       values = getRandomLongs(numValues, false);
       sortedValues = values.stream().sorted().collect(Collectors.toList());
-    } while ((max = sortedValues.get(sortedValues.size() - 1)) >= Integer.MAX_VALUE - numValues); // leave room for rounding 
+    } while ((max = sortedValues.get(sortedValues.size() - 1)) >= Long.MAX_VALUE - numValues); // leave room for rounding 
     long min = sortedValues.get(0);
     long gap = BigInteger.valueOf(max + numValues).subtract(BigInteger.valueOf(min))
         .divide(BigInteger.valueOf(numBuckets)).longValueExact();
@@ -2183,9 +2183,6 @@ public class TestPointFields extends SolrTestCaseJ4 {
 
   
   private void testPointStats(String field, String dvField, String[] numbers, double min, double max, int count, int missing, double delta) {
-    clearIndex();
-    assertU(commit());
-
     String minMin = String.valueOf(min - Math.abs(delta*min));
     String maxMin = String.valueOf(min + Math.abs(delta*min));
     String minMax = String.valueOf(max - Math.abs(delta*max));
@@ -2198,7 +2195,7 @@ public class TestPointFields extends SolrTestCaseJ4 {
     assertTrue(h.getCore().getLatestSchema().getField(dvField).hasDocValues());
     assertTrue(h.getCore().getLatestSchema().getField(dvField).getType() instanceof PointField);
     assertQ(req("q", "*:*", "fl", "id, " + dvField, "stats", "true", "stats.field", dvField), 
-        "//*[@numFound='11']",
+        "//*[@numFound='" + (numbers.length + 1) + "']",
         "//lst[@name='stats']/lst[@name='stats_fields']/lst[@name='" + dvField+ "']/double[@name='min'][.>=" + minMin + "]",
         "//lst[@name='stats']/lst[@name='stats_fields']/lst[@name='" + dvField+ "']/double[@name='min'][.<=" + maxMin+ "]",
         "//lst[@name='stats']/lst[@name='stats_fields']/lst[@name='" + dvField+ "']/double[@name='max'][.>=" + minMax + "]",
@@ -3303,7 +3300,7 @@ public class TestPointFields extends SolrTestCaseJ4 {
     assertTrue(h.getCore().getLatestSchema().getField(dvField).hasDocValues());
     assertTrue(h.getCore().getLatestSchema().getField(dvField).getType() instanceof PointField);
     assertQ(req("q", "*:*", "fl", "id, " + dvField, "stats", "true", "stats.field", dvField),
-        "//*[@numFound='11']",
+        "//*[@numFound='" + (dates.length + 1) + "']",
         "//lst[@name='stats']/lst[@name='stats_fields']/lst[@name='" + dvField+ "']/date[@name='min'][.='" + dates[0] + "']",
         "//lst[@name='stats']/lst[@name='stats_fields']/lst[@name='" + dvField+ "']/date[@name='max'][.='" + dates[dates.length-1] + "']",
         "//lst[@name='stats']/lst[@name='stats_fields']/lst[@name='" + dvField+ "']/long[@name='count'][.='" + dates.length + "']",