Skip to content

Commit 7de66e7

Browse files
committed
Experiment to reduce serverless flakiness
1 parent 0f90ddb commit 7de66e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/GeoHexBoundedPredicate.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
public class GeoHexBoundedPredicate {
1818

1919
private final boolean crossesDateline;
20-
private final GeoBoundingBox bbox, scratch;
20+
private final GeoBoundingBox bbox;
2121

2222
GeoHexBoundedPredicate(GeoBoundingBox bbox) {
2323
this.crossesDateline = bbox.right() < bbox.left();
2424
// TODO remove this once we get serverless flaky tests to pass
2525
// assert this.crossesDateline == false;
2626
this.bbox = bbox;
27-
scratch = new GeoBoundingBox(new org.elasticsearch.common.geo.GeoPoint(), new org.elasticsearch.common.geo.GeoPoint());
2827
}
2928

3029
public boolean validHex(long hex) {
30+
GeoBoundingBox scratch = new GeoBoundingBox(
31+
new org.elasticsearch.common.geo.GeoPoint(),
32+
new org.elasticsearch.common.geo.GeoPoint()
33+
);
3134
H3SphericalUtil.computeGeoBounds(hex, scratch);
3235
if (bbox.top() > scratch.bottom() && bbox.bottom() < scratch.top()) {
3336
if (scratch.left() > scratch.right()) {

0 commit comments

Comments
 (0)