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/23 11:23:46 UTC

lucene-solr:branch_6_0: disable query cache when this test uses threads, so seeds reliably reproduce

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_0 0745413f3 -> 7667b67c8


disable query cache when this test uses threads, so seeds reliably reproduce


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

Branch: refs/heads/branch_6_0
Commit: 7667b67c81bd550946491d995ff5edcdacaee412
Parents: 0745413
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Mar 23 06:20:26 2016 -0400
Committer: Mike McCandless <mi...@apache.org>
Committed: Wed Mar 23 06:24:43 2016 -0400

----------------------------------------------------------------------
 .../apache/lucene/spatial/util/BaseGeoPointTestCase.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7667b67c/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java b/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
index 593dbe9..622a59d 100644
--- a/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
+++ b/lucene/spatial/src/test/org/apache/lucene/spatial/util/BaseGeoPointTestCase.java
@@ -641,6 +641,13 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
     // We can't wrap with "exotic" readers because the BKD query must see the BKDDVFormat:
     IndexSearcher s = newSearcher(r, false);
 
+    if (useThreads) {
+      // We must disable query cache otherwise test seed may not reproduce since different
+      // threads may or may not get a cache hit or miss depending on order the JVM
+      // schedules the threads:
+      s.setQueryCache(null);
+    }
+
     // Make sure queries are thread safe:
     int numThreads;
     if (useThreads) {
@@ -750,8 +757,8 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
                     @Override
                     protected void describe(int docID, double pointLat, double pointLon) {
                       double distanceMeters = SloppyMath.haversinMeters(centerLat, centerLon, pointLat, pointLon);
-                      System.out.println("  docID=" + docID + " centerLon=" + centerLon + " centerLat=" + centerLat
-                          + " pointLon=" + pointLon + " pointLat=" + pointLat + " distanceMeters=" + distanceMeters
+                      System.out.println("  docID=" + docID + " centerLat=" + centerLat + " centerLon=" + centerLon
+                          + " pointLat=" + pointLat + " pointLon=" + pointLon + " distanceMeters=" + distanceMeters
                           + " vs" + ((rangeQuery == true) ? " minRadiusMeters=" + minRadiusMeters : "") + " radiusMeters=" + radiusMeters);
                     }
                    };