**Build scan:**
https://gradle-enterprise.elastic.co/s/ask5vfgjvbbuo/tests/:x-pack:plugin:spatial:test/org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoHashTilerTests/testGeoGridSetValuesBoundingBoxes_BoundedGeoShapeCellValues

**Reproduction line:**
`./gradlew ':x-pack:plugin:spatial:test' --tests "org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoHashTilerTests.testGeoGridSetValuesBoundingBoxes_BoundedGeoShapeCellValues" -Dtests.seed=7484FE1A8DCD8AE6 -Dtests.locale=pt -Dtests.timezone=Brazil/Acre -Druntime.java=11 -Dtests.fips.enabled=true`

**Applicable branches:**
7.17

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoHashTilerTests&tests.test=testGeoGridSetValuesBoundingBoxes_BoundedGeoShapeCellValues

**Failure excerpt:**
```
java.lang.IllegalArgumentException: Unable to Tessellate shape [[2.6667632497094215E-156, -4.1009676073883347E-303] [2.6667632497094215E-156, -2.606373471402386E-280] [1.8928815155191063E-270, -2.606373471402386E-280] [1.8928815155191063E-270, -4.1009676073883347E-303] [2.6667632497094215E-156, -4.1009676073883347E-303] ]. Possible malformed shape detected.

  at __randomizedtesting.SeedInfo.seed([7484FE1A8DCD8AE6:78F04FD79E29BB77]:0)
  at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:116)
  at org.apache.lucene.document.LatLonShape.createIndexableFields(LatLonShape.java:72)
  at org.elasticsearch.index.mapper.GeoShapeIndexer$LuceneGeometryIndexer.visit(GeoShapeIndexer.java:246)
  at org.elasticsearch.index.mapper.GeoShapeIndexer$LuceneGeometryIndexer.visit(GeoShapeIndexer.java:178)
  at org.elasticsearch.geometry.Polygon.visit(Polygon.java:84)
  at org.elasticsearch.index.mapper.GeoShapeIndexer.indexShape(GeoShapeIndexer.java:174)
  at org.elasticsearch.xpack.spatial.util.GeoTestUtils.binaryGeoShapeDocValuesField(GeoTestUtils.java:54)
  at org.elasticsearch.xpack.spatial.util.GeoTestUtils.geoShapeValue(GeoTestUtils.java:60)
  at org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoGridTilerTestCase.testGeoGridSetValuesBoundingBoxes_BoundedGeoShapeCellValues(GeoGridTilerTestCase.java:116)
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:566)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
  at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
  at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
  at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
  at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
  at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
  at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
  at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
  at java.lang.Thread.run(Thread.java:834)

```
x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/bucket/geogrid/GeoGridTilerTestCase.java
return false;
                } catch (Exception e) {
                    return true;
                }
            }, () -> boxToGeo(randomBBox())));
            GeoBoundingBox geoBoundingBox = randomValueOtherThanMany(b -> b.right() == -180 && b.left() == 180, () -> randomBBox());
            GeoShapeValues.GeoShapeValue value = geoShapeValue(geometry);
            GeoShapeCellValues cellValues = new GeoShapeCellValues(
                makeGeoShapeValues(value),
                getBoundedGridTiler(geoBoundingBox, precision),
                NOOP_BREAKER
            );
            assertTrue(cellValues.advanceExact(0));
            int numBuckets = cellValues.docValueCount();
            int expected = expectedBuckets(value, precision, geoBoundingBox);
            assertThat(numBuckets, equalTo(expected));
        }
    }
    
    public void testGeoGridSetValuesBoundingBoxes_coversAllLongitudeValues() throws Exception {
        int precision = 3;
        Geometry geometry = new Rectangle(-92, 180, 0.99, -89);
        GeoBoundingBox geoBoundingBox = new GeoBoundingBox(new GeoPoint(5, 0.6), new GeoPoint(-5, 0.5));
        GeoShapeValues.GeoShapeValue value = geoShapeValue(geometry);
        GeoShapeCellValues cellValues = new GeoShapeCellValues(
            makeGeoShapeValues(value),
            getBoundedGridTiler(geoBoundingBox, precision),
            NOOP_BREAKER
        );
        assertTrue(cellValues.advanceExact(0));