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 4d25451c704..fd97207ef75 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 @@ -19,14 +19,11 @@ package org.apache.lucene.spatial.util; import java.io.IOException; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; -import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.HashSet; -import java.util.List; import java.util.Locale; import java.util.Set; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.lucene.analysis.MockAnalyzer; @@ -325,7 +322,7 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { double[] lons = new double[numPoints]; Arrays.fill(lons, theLon); - verify(small, lats, lons, false); + verify(small, lats, lons); } public void testAllLatEqual() throws Exception { @@ -372,7 +369,7 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { lats[docID] = lat; } - verify(small, lats, lons, false); + verify(small, lats, lons); } public void testAllLonEqual() throws Exception { @@ -421,7 +418,7 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { lons[docID] = theLon; } - verify(small, lats, lons, false); + verify(small, lats, lons); } public void testMultiValued() throws Exception { @@ -535,25 +532,21 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { public void testRandomTiny() throws Exception { // Make sure single-leaf-node case is OK: - doTestRandom(10, false); + doTestRandom(10); } public void testRandomMedium() throws Exception { - doTestRandom(10000, false); - } - - public void testRandomWithThreads() throws Exception { - doTestRandom(10000, true); + doTestRandom(10000); } @Nightly public void testRandomBig() throws Exception { assumeFalse("Direct codec can OOME on this test", TestUtil.getDocValuesFormat(FIELD_NAME).equals("Direct")); assumeFalse("Memory codec can OOME on this test", TestUtil.getDocValuesFormat(FIELD_NAME).equals("Memory")); - doTestRandom(200000, false); + doTestRandom(200000); } - private void doTestRandom(int count, boolean useThreads) throws Exception { + private void doTestRandom(int count) throws Exception { int numPoints = atLeast(count); @@ -621,7 +614,7 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { } } - verify(small, lats, lons, useThreads); + verify(small, lats, lons); } public double randomLat(boolean small) { @@ -808,7 +801,7 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase { protected abstract void describe(int docID, double lat, double lon); } - protected void verify(boolean small, double[] lats, double[] lons, boolean useThreads) throws Exception { + protected void verify(boolean small, double[] lats, double[] lons) throws Exception { IndexWriterConfig iwc = newIndexWriterConfig(); // Else we can get O(N^2) merging: int mbd = iwc.getMaxBufferedDocs(); @@ -852,189 +845,138 @@ 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) { - numThreads = TestUtil.nextInt(random(), 2, 5); - } else { - numThreads = 1; - } - - List threads = new ArrayList<>(); final int iters = atLeast(75); - final CountDownLatch startingGun = new CountDownLatch(1); final AtomicBoolean failed = new AtomicBoolean(); - for(int i=0;i