Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset queryGeometry in ShapeQueryTests #45974

Merged
merged 2 commits into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public void setUp() throws Exception {

// index random shapes
numDocs = randomIntBetween(25, 50);
// reset query geometry to make sure we pick one from the indexed shapes
queryGeometry = null;
Geometry geometry;
for (int i = 0; i < numDocs; ++i) {
geometry = ShapeTestUtils.randomGeometry(false);
Expand All @@ -77,6 +79,10 @@ public void setUp() throws Exception {
client().prepareIndex(IGNORE_MALFORMED_INDEX, FIELD_TYPE).setRefreshPolicy(IMMEDIATE).setSource(geoJson).get();
} catch (Exception e) {
// sometimes GeoTestUtil will create invalid geometry; catch and continue:
if (queryGeometry == geometry) {
// reset query geometry as it didn't get indexed
queryGeometry = null;
}
--i;
continue;
}
Expand Down Expand Up @@ -227,7 +233,6 @@ public void testExistsQuery() {
assertHitCount(result, numDocs);
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/45628")
public void testFieldAlias() {
SearchResponse response = client().prepareSearch(INDEX)
.setQuery(new ShapeQueryBuilder("alias", queryGeometry).relation(ShapeRelation.INTERSECTS))
Expand Down