Tests: disable testRandomGeoCollectionQuery on tiny polygons (#37579)

Due to https://issues.apache.org/jira/browse/LUCENE-8634 this test
may fail if a really tiny polygon is generated. This commit checks for
tiny polygons and skips the final check, which is expected to fail
until the lucene bug is fixed and new version of lucene is released.
This commit is contained in:
Igor Motov 2019-01-23 12:25:54 -05:00 committed by GitHub
parent 427bc7f940
commit e3672aa551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -395,6 +395,9 @@ public class GeoShapeQueryTests extends ESSingleNodeTestCase {
geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS); geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS);
SearchResponse result = client().prepareSearch("test").setQuery(geoShapeQueryBuilder).get(); SearchResponse result = client().prepareSearch("test").setQuery(geoShapeQueryBuilder).get();
assertSearchResponse(result); 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);
assertHitCount(result, 1); assertHitCount(result, 1);
} }
@ -423,7 +426,8 @@ public class GeoShapeQueryTests extends ESSingleNodeTestCase {
} }
gcb.shape(new PolygonBuilder(cb)); gcb.shape(new PolygonBuilder(cb));
logger.info("Created Random GeometryCollection containing {} shapes", gcb.numShapes()); logger.info("Created Random GeometryCollection containing {} shapes using {} tree", gcb.numShapes(),
usePrefixTrees ? "default" : "quadtree");
if (usePrefixTrees == false) { if (usePrefixTrees == false) {
client().admin().indices().prepareCreate("test").addMapping("type", "location", "type=geo_shape") client().admin().indices().prepareCreate("test").addMapping("type", "location", "type=geo_shape")
@ -444,7 +448,11 @@ public class GeoShapeQueryTests extends ESSingleNodeTestCase {
geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS); geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS);
SearchResponse result = client().prepareSearch("test").setQuery(geoShapeQueryBuilder).get(); SearchResponse result = client().prepareSearch("test").setQuery(geoShapeQueryBuilder).get();
assertSearchResponse(result); assertSearchResponse(result);
assertTrue(result.getHits().getTotalHits().value > 0); 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);
} }
/** tests querying a random geometry collection with a point */ /** tests querying a random geometry collection with a point */