geospatial
geospatial copied to clipboard
[FlakyTest]org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests.testIndexingMultiPolygon
REPRODUCE WITH: ./gradlew ':test' --tests "org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests.testIndexingMultiPolygon" -Dtests.seed=C317A78A633C1A58 -Dtests.security.manager=false -Dtests.locale=ar-TN -Dtests.timezone=Australia/Darwin -Druntime.java=17
> Task :test
org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests > testIndexingMultiPolygon FAILED
java.lang.IllegalArgumentException: at least three non-collinear points required
at __randomizedtesting.SeedInfo.seed([C317A78A633C1A58:FF568A98481069AA]:0)
at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:174)
at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:152)
Suite: Test class org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests
2> REPRODUCE WITH: ./gradlew ':test' --tests "org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests.testIndexingMultiPolygon" -Dtests.seed=C317A78A633C1A58 -Dtests.security.manager=false -Dtests.locale=ar-TN -Dtests.timezone=Australia/Darwin -Druntime.java=17
2> java.lang.IllegalArgumentException: at least three non-collinear points required
at __randomizedtesting.SeedInfo.seed([C317A78A633C1A58:FF568A98481069AA]:0)
at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:174)
at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:152)
at org.apache.lucene.document.XYShape.createIndexableFields(XYShape.java:100)
at org.apache.lucene.document.XYShape.createIndexableFields(XYShape.java:84)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.createIndexableFields(XYShapeIndexableFieldsVisitor.java:107)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.visit(XYShapeIndexableFieldsVisitor.java:97)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.visit(XYShapeIndexableFieldsVisitor.java:40)
at org.opensearch.geometry.Polygon.visit(Polygon.java:109)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.lambda$visitCollection$0(XYShapeIndexableFieldsVisitor.java:112)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.visitCollection(XYShapeIndexableFieldsVisitor.java:112)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.visit(XYShapeIndexableFieldsVisitor.java:84)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitor.visit(XYShapeIndexableFieldsVisitor.java:40)
at org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests.testIndexingMultiPolygon(XYShapeIndexableFieldsVisitorTests.java:121)
There is a bug in this method https://github.com/apache/lucene/blob/main/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java#L156
It fails to generate correct polygon.
The issue is temporary fixed as of now. For a proper fix, we need a fix in lucene library. https://github.com/apache/lucene/pull/12287 and https://github.com/apache/lucene/issues/12596