Skip to content

Commit

Permalink
Tests: disable testRandomGeoCollectionQuery on tiny polygons (#37579)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
imotov committed Jan 23, 2019
1 parent 6551e5d commit 961162a
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ public void testShapeFetchingPath() throws Exception {
assertHitCount(result, 1);
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37356")
public void testQueryRandomGeoCollection() throws Exception {
// Create a random geometry collection.
GeometryCollectionBuilder gcb = RandomShapeGenerator.createGeometryCollection(random());
Expand Down Expand Up @@ -358,6 +357,9 @@ public void testQueryRandomGeoCollection() 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);
assertHitCount(result, 1);
}

Expand Down Expand Up @@ -386,7 +388,8 @@ public void testRandomGeoCollectionQuery() throws Exception {
}
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) {
client().admin().indices().prepareCreate("test").addMapping("type", "location", "type=geo_shape")
Expand All @@ -407,7 +410,11 @@ public void testRandomGeoCollectionQuery() throws Exception {
geoShapeQueryBuilder.relation(ShapeRelation.INTERSECTS);
SearchResponse result = client().prepareSearch("test").setTypes("type").setQuery(geoShapeQueryBuilder).get();
assertSearchResponse(result);
assertTrue(result.getHits().getTotalHits() > 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() > 0);
}

/** tests querying a random geometry collection with a point */
Expand Down

0 comments on commit 961162a

Please sign in to comment.