1
0
Эх сурвалжийг харах

Add workaround in SpatialPushDownGeoPointIT to avoid lucene issue (#112388)

Ignacio Vera 1 жил өмнө
parent
commit
17120c097e

+ 0 - 3
muted-tests.yml

@@ -71,9 +71,6 @@ tests:
 - class: org.elasticsearch.nativeaccess.VectorSystemPropertyTests
   method: testSystemPropertyDisabled
   issue: https://github.com/elastic/elasticsearch/issues/110949
-- class: org.elasticsearch.xpack.esql.spatial.SpatialPushDownGeoPointIT
-  method: testPushedDownQueriesSingleValue
-  issue: https://github.com/elastic/elasticsearch/issues/111084
 - class: org.elasticsearch.multi_node.GlobalCheckpointSyncActionIT
   issue: https://github.com/elastic/elasticsearch/issues/111124
 - class: org.elasticsearch.cluster.PrevalidateShardPathIT

+ 6 - 1
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/spatial/SpatialPushDownGeoPointIT.java

@@ -7,11 +7,14 @@
 
 package org.elasticsearch.xpack.esql.spatial;
 
+import org.apache.lucene.geo.GeoEncodingUtils;
 import org.elasticsearch.geo.GeometryTestUtils;
 import org.elasticsearch.geometry.Geometry;
 
 public class SpatialPushDownGeoPointIT extends SpatialPushDownTestCase {
 
+    private static final double LAT_MAX_VALUE = GeoEncodingUtils.decodeLatitude(Integer.MAX_VALUE - 3);
+
     @Override
     protected String fieldType() {
         return "geo_point";
@@ -19,7 +22,9 @@ public class SpatialPushDownGeoPointIT extends SpatialPushDownTestCase {
 
     @Override
     protected Geometry getIndexGeometry() {
-        return GeometryTestUtils.randomPoint();
+        // This is to overcome lucene bug https://github.com/apache/lucene/issues/13703.
+        // Once it is fixed we can remove this workaround.
+        return randomValueOtherThanMany(p -> p.getLat() >= LAT_MAX_VALUE, GeometryTestUtils::randomPoint);
     }
 
     @Override