You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/03/05 10:56:37 UTC

lucene-solr git commit: fix very rare test bug that I somehow hit

Repository: lucene-solr
Updated Branches:
  refs/heads/master 9c8cbefbf -> f1c044a2d


fix very rare test bug that I somehow hit


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

Branch: refs/heads/master
Commit: f1c044a2d77956fdda789c809f7a99b0a0f68a5a
Parents: 9c8cbef
Author: Mike McCandless <mi...@apache.org>
Authored: Sat Mar 5 04:57:14 2016 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Sat Mar 5 04:57:14 2016 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/facet/range/TestRangeFacetCounts.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1c044a2/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
----------------------------------------------------------------------
diff --git a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
index e7e5d57..9fde6e3 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java
@@ -421,7 +421,10 @@ public class TestRangeFacetCounts extends FacetTestCase {
         }
         boolean minIncl;
         boolean maxIncl;
-        if (min == max) {
+
+        // NOTE: max - min >= 0 is here to handle the common overflow case!
+        if (max - min >= 0 && max - min < 2) {
+          // If max == min or max == min+1, we always do inclusive, else we might pass an empty range and hit exc from LongRange's ctor:
           minIncl = true;
           maxIncl = true;
         } else {