From 0411b34984055a28391d5a09f700d091f74677e5 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Thu, 21 Feb 2019 16:18:04 -0500 Subject: [PATCH] [CI] Fixes testQueryRandomGeoCollection failure again Moves the check for tiny polygons earlier in the test. It turned out that polygons can be so tiny that we cannot even figure out their orientation. Relates to #37356 --- .../org/elasticsearch/search/geo/GeoShapeQueryTests.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java b/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java index 3cb71f6be235c..3d1d5b6876a65 100644 --- a/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java @@ -420,6 +420,10 @@ public void testRandomGeoCollectionQuery() throws Exception { } } org.apache.lucene.geo.Polygon randomPoly = GeoTestUtil.nextPolygon(); + + assumeTrue("Skipping the check for the polygon with a degenerated dimension", + randomPoly.maxLat - randomPoly.minLat > 8.4e-8 && randomPoly.maxLon - randomPoly.minLon > 8.4e-8); + CoordinatesBuilder cb = new CoordinatesBuilder(); for (int i = 0; i < randomPoly.numPoints(); ++i) { cb.coordinate(randomPoly.getPolyLon(i), randomPoly.getPolyLat(i)); @@ -448,9 +452,6 @@ public void testRandomGeoCollectionQuery() throws Exception { geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS); SearchResponse result = client().prepareSearch("test").setQuery(geoShapeQueryBuilder).get(); assertSearchResponse(result); - assumeTrue("Skipping the check for the polygon with a degenerated dimension until " - +" https://issues.apache.org/jira/browse/LUCENE-8634 is fixed", - randomPoly.maxLat - randomPoly.minLat > 8.4e-8 && randomPoly.maxLon - randomPoly.minLon > 8.4e-8); assertTrue("query: " + geoShapeQueryBuilder.toString() + " doc: " + Strings.toString(docSource), result.getHits().getTotalHits().value > 0); }