Skip to content

Apache Lucene open-source search software

LUCENE-8350: Fix for time-out in RandomGeoPolygonTests

ivera36b7cdde06d7
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
index 45074503cb9..07361e82c1d 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/RandomGeoPolygonTest.java
@@ -120,11 +120,12 @@ public class RandomGeoPolygonTest extends RandomGeo3dShapeGenerator {
referencePoint = randomGeoPoint(planetModel);
}
final int n = random().nextInt(4) + 4;
- final List<GeoPoint> points = new ArrayList<>(n);
+
List<GeoPoint> orderedPoints = null;
GeoPolygon polygon = null;
GeoPolygon largePolygon = null;
do {
+ final List<GeoPoint> points = new ArrayList<>(n);
double maxDistance = random().nextDouble() * limitDistance;
//if distance is too small we can fail
//building the polygon.