Fix reproducible GeoDistanceRangeQueryTests.testToQuery error
This issue occurs if the center latitude of the GeoPointDistance query is set to one of the poles. Since this issue is set to be fixed in LUCENE-6897 this commit temporarily limits the random latitudinal location to not include the poles.
This commit is contained in:
parent
e4cc94c11e
commit
7f5da1d6a3
|
@ -44,14 +44,14 @@ public class GeoDistanceRangeQueryTests extends AbstractQueryTestCase<GeoDistanc
|
|||
protected GeoDistanceRangeQueryBuilder doCreateTestQueryBuilder() {
|
||||
Version version = queryShardContext().indexVersionCreated();
|
||||
GeoDistanceRangeQueryBuilder builder;
|
||||
GeoPoint randomPoint = RandomGeoGenerator.randomPointIn(random(), -180.0, -89.9, 180.0, 89.9);
|
||||
if (randomBoolean()) {
|
||||
builder = new GeoDistanceRangeQueryBuilder(GEO_POINT_FIELD_NAME, randomGeohash(3, 12));
|
||||
builder = new GeoDistanceRangeQueryBuilder(GEO_POINT_FIELD_NAME, randomPoint.geohash());
|
||||
} else {
|
||||
GeoPoint point = RandomGeoGenerator.randomPoint(random());
|
||||
if (randomBoolean()) {
|
||||
builder = new GeoDistanceRangeQueryBuilder(GEO_POINT_FIELD_NAME, point);
|
||||
builder = new GeoDistanceRangeQueryBuilder(GEO_POINT_FIELD_NAME, randomPoint);
|
||||
} else {
|
||||
builder = new GeoDistanceRangeQueryBuilder(GEO_POINT_FIELD_NAME, point.lat(), point.lon());
|
||||
builder = new GeoDistanceRangeQueryBuilder(GEO_POINT_FIELD_NAME, randomPoint.lat(), randomPoint.lon());
|
||||
}
|
||||
}
|
||||
GeoPoint point = builder.point();
|
||||
|
|
Loading…
Reference in New Issue