geospatial icon indicating copy to clipboard operation
geospatial copied to clipboard

[FlakyTest]org.opensearch.geospatial.index.mapper.xyshape.XYShapeIndexableFieldsVisitorTests.testIndexingMultiPolygon

Open heemin32 opened this issue 1 year ago • 2 comments

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)

heemin32 avatar May 05 '23 23:05 heemin32

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.

heemin32 avatar May 19 '23 17:05 heemin32

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

heemin32 avatar Sep 26 '23 17:09 heemin32