**Build scan:**
https://gradle-enterprise.elastic.co/s/63aedpbdwdrbw/tests/:x-pack:plugin:analytics:test/org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests/testSmallerRangesAccuracy

**Reproduction line:**
```
./gradlew ':x-pack:plugin:analytics:test' --tests "org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testSmallerRangesAccuracy" -Dtests.seed=8DAB79691C32E074 -Dtests.locale=sl -Dtests.timezone=US/Indiana-Starke -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**

Did not reproduce with a seed, however it happens about 2-3% of cases when running in a loop

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests&tests.test=testSmallerRangesAccuracy

**Failure excerpt:**
```
java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.elasticsearch.common.breaker.CircuitBreakingException: cranky breaker

  at __randomizedtesting.SeedInfo.seed([8DAB79691C32E074:A5F8299A97B205B1]:0)
  at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:730)
  at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:688)
  at org.elasticsearch.search.aggregations.AggregatorTestCase.searchAndReduce(AggregatorTestCase.java:588)
  at org.elasticsearch.search.aggregations.AggregatorTestCase.runWithCrankyCircuitBreaker(AggregatorTestCase.java:489)
  at org.elasticsearch.search.aggregations.AggregatorTestCase.searchAndReduce(AggregatorTestCase.java:472)
  at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testRanges(HistoBackedRangeAggregatorTests.java:178)
  at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testSmallerRangesAccuracy(HistoBackedRangeAggregatorTests.java:158)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  at java.lang.reflect.Method.invoke(Method.java:578)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  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.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1623)

  Caused by: java.util.concurrent.ExecutionException: org.elasticsearch.common.breaker.CircuitBreakingException: cranky breaker

    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:191)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:726)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:688)
    at org.elasticsearch.search.aggregations.AggregatorTestCase.searchAndReduce(AggregatorTestCase.java:588)
    at org.elasticsearch.search.aggregations.AggregatorTestCase.runWithCrankyCircuitBreaker(AggregatorTestCase.java:489)
    at org.elasticsearch.search.aggregations.AggregatorTestCase.searchAndReduce(AggregatorTestCase.java:472)
    at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testRanges(HistoBackedRangeAggregatorTests.java:178)
    at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testSmallerRangesAccuracy(HistoBackedRangeAggregatorTests.java:158)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke(Method.java:578)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
    at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
    at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
    at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
    at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
    at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
    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.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
    at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
    at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
    at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
    at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
    at java.lang.Thread.run(Thread.java:1623)

    Caused by: org.elasticsearch.common.breaker.CircuitBreakingException: cranky breaker

      at org.elasticsearch.indices.CrankyCircuitBreakerService$1.addEstimateBytesAndMaybeBreak(CrankyCircuitBreakerService.java:38)
      at org.elasticsearch.common.util.BigArrays.adjustBreaker(BigArrays.java:466)
      at org.elasticsearch.common.util.BigArrays.validate(BigArrays.java:524)
      at org.elasticsearch.common.util.BigArrays.newLongArray(BigArrays.java:677)
      at org.elasticsearch.common.util.MockBigArrays.newLongArray(MockBigArrays.java:226)
      at org.elasticsearch.common.util.BigArrays.resize(BigArrays.java:695)
      at org.elasticsearch.common.util.MockBigArrays.resize(MockBigArrays.java:237)
      at org.elasticsearch.common.util.BigArrays.grow(BigArrays.java:709)
      at org.elasticsearch.search.aggregations.bucket.BucketsAggregator.grow(BucketsAggregator.java:72)
      at org.elasticsearch.search.aggregations.bucket.BucketsAggregator.collectBucket(BucketsAggregator.java:79)
      at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregator$NoOverlap.collect(HistoBackedRangeAggregator.java:191)
      at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregator$1.collect(HistoBackedRangeAggregator.java:137)
      at org.elasticsearch.search.aggregations.LeafBucketCollector.collect(LeafBucketCollector.java:86)
      at org.apache.lucene.tests.search.AssertingLeafCollector.collect(AssertingLeafCollector.java:52)
      at org.apache.lucene.tests.search.AssertingCollector$1.collect(AssertingCollector.java:66)
      at org.apache.lucene.tests.search.AssertingLeafCollector.collect(AssertingLeafCollector.java:52)
      at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:305)
      at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:247)
      at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:38)
      at org.apache.lucene.tests.search.AssertingBulkScorer.score(AssertingBulkScorer.java:75)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:776)
      at org.apache.lucene.tests.search.AssertingIndexSearcher.search(AssertingIndexSearcher.java:78)
      at org.apache.lucene.search.IndexSearcher.lambda$search$1(IndexSearcher.java:715)
      at java.util.concurrent.FutureTask.run(FutureTask.java:317)
      at org.apache.lucene.search.SliceExecutor.invokeAll(SliceExecutor.java:40)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:722)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:688)
      at org.elasticsearch.search.aggregations.AggregatorTestCase.searchAndReduce(AggregatorTestCase.java:588)
      at org.elasticsearch.search.aggregations.AggregatorTestCase.runWithCrankyCircuitBreaker(AggregatorTestCase.java:489)
      at org.elasticsearch.search.aggregations.AggregatorTestCase.searchAndReduce(AggregatorTestCase.java:472)
      at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testRanges(HistoBackedRangeAggregatorTests.java:178)
      at org.elasticsearch.xpack.analytics.aggregations.bucket.range.HistoBackedRangeAggregatorTests.testSmallerRangesAccuracy(HistoBackedRangeAggregatorTests.java:158)
      at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.lang.reflect.Method.invoke(Method.java:578)
      at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
      at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
      at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
      at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
      at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
      at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
      at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
      at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
      at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
      at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
      at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
      at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
      at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
      at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
      at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
      at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
      at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
      at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
      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.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
      at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
      at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
      at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
      at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
      at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
      at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
      at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
      at java.lang.Thread.run(Thread.java:1623)

```
x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/aggregations/bucket/range/HistoBackedRangeAggregatorTests.java
}
    public void testSmallerRangesAccuracy() throws Exception {
        List<RangeAggregator.Range> ranges = Arrays.asList(
            new RangeAggregator.Range(null, null, 1.0),
            new RangeAggregator.Range(null, 1.0, 1.5),
            new RangeAggregator.Range(null, 1.5, 2.0),
            new RangeAggregator.Range(null, 2.0, 2.5),
            new RangeAggregator.Range(null, 2.5, 3.0),
            new RangeAggregator.Range(null, 3.0, 3.5),
            new RangeAggregator.Range(null, 3.5, 4.0),
            new RangeAggregator.Range(null, 4.0, 4.5),
            new RangeAggregator.Range(null, 4.5, 5.0),
            new RangeAggregator.Range(null, 5.0, 5.5),
            new RangeAggregator.Range(null, 5.5, 6.0),
            new RangeAggregator.Range(null, 6.0, 6.5),
            new RangeAggregator.Range(null, 6.5, 7.0),
            new RangeAggregator.Range(null, 7.0, 7.5),
            new RangeAggregator.Range(null, 7.5, 8.0),
            new RangeAggregator.Range(null, 8.0, 8.5),
            new RangeAggregator.Range(null, 8.5, 9.0),
            new RangeAggregator.Range(null, 9.0, 9.5),
            new RangeAggregator.Range(null, 9.5, 10.0),
            new RangeAggregator.Range(null, 10.0, 10.5),
            new RangeAggregator.Range(null, 10.5, 11.0),
            new RangeAggregator.Range(null, 11.0, 11.5),
            new RangeAggregator.Range(null, 11.5, 12.0),
            new RangeAggregator.Range(null, 12.0, null)
        );
        testRanges(ranges, "manual_small_ranges");
    }