Skip to content

Commit

Permalink
[CI] Fixes testQueryRandomGeoCollection failure again (#39275)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
imotov committed Feb 25, 2019
1 parent f84812f commit 91a6bd3
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,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));
Expand Down Expand Up @@ -410,9 +414,6 @@ public void testRandomGeoCollectionQuery() throws Exception {
geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS);
SearchResponse result = client().prepareSearch("test").setTypes("type").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() > 0);
}
Expand Down

0 comments on commit 91a6bd3

Please sign in to comment.