### CI Link

https://gradle-enterprise.elastic.co/s/4loz5k2jllcvg

### Repro line

`./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.search.aggregations.metrics.HDRPercentilesIT.testScriptSingleValued" -Dtests.seed=928B8BBC20C73401 -Dtests.locale=de-CH -Dtests.timezone=America/Argentina/Catamarca -Druntime.java=19`

### Does it reproduce?

Yes

### Applicable branches

https://github.com/elastic/elasticsearch/pull/92817 (a small change over main)

### Failure history

_No response_

### Failure excerpt

I encountered this a few times in https://github.com/elastic/elasticsearch/pull/92817, which is effectively `main` plus the following patch which should not cause any failures:


```diff
diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java
index 18f21cb7368..c51df18675c 100644
--- a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java
+++ b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java
@@ -152,7 +152,6 @@ import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.greaterThanOrEqualTo;
 import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
@@ -603,6 +602,8 @@ public final class InternalTestCluster extends TestCluster {
             );
         }

+        builder.put(INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s");
+
         return builder.build();
     }

@@ -731,14 +732,6 @@ public final class InternalTestCluster extends TestCluster {
         updatedSettings.put("node.name", name);
         updatedSettings.put(NodeEnvironment.NODE_ID_SEED_SETTING.getKey(), seed);

-        if (autoManageMasterNodes) {
-            assertThat(
-                "if master nodes are automatically managed then nodes must complete a join cycle when starting",
-                updatedSettings.get(INITIAL_STATE_TIMEOUT_SETTING.getKey()),
-                nullValue()
-            );
-        }
-
         return updatedSettings.build();
     }
```

The failure is as follows:

```
org.elasticsearch.search.aggregations.metrics.HDRPercentilesIT > testScriptSingleValued FAILED	
    java.lang.AssertionError: 	
    Expected: a value less than or equal to <10.00100068359375>	
         but: <10.0068359375> was greater than <10.00100068359375>	
        at __randomizedtesting.SeedInfo.seed([928B8BBC20C73401:2E3A0A78C1851C92]:0)	
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)	
        at org.junit.Assert.assertThat(Assert.java:956)	
        at org.junit.Assert.assertThat(Assert.java:923)	
        at org.elasticsearch.search.aggregations.metrics.HDRPercentilesIT.assertConsistent(HDRPercentilesIT.java:87)	
        at org.elasticsearch.search.aggregations.metrics.HDRPercentilesIT.testScriptSingleValued(HDRPercentilesIT.java:376)	
```
server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentilesIT.java
double previous = asc ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        for (Histogram.Bucket bucket : histo.getBuckets()) {
            Percentiles percentiles = bucket.getAggregations().get("percentiles");
            double p99 = percentiles.percentile(99);
            if (asc) {
                assertThat(p99, greaterThanOrEqualTo(previous));
            } else {
                assertThat(p99, lessThanOrEqualTo(previous));
            }
            previous = p99;
        }
    }
    @Override
    public void testOrderByEmptyAggregation() throws Exception {
        SearchResponse searchResponse = client().prepareSearch("idx")
            .setQuery(matchAllQuery())
            .addAggregation(
                terms("terms").field("value")
                    .order(BucketOrder.compound(BucketOrder.aggregation("filter>percentiles.99", true)))
                    .subAggregation(
                        filter("filter", termQuery("value", 100)).subAggregation(
                            percentiles("percentiles").method(PercentilesMethod.HDR).field("value")
                        )
                    )
            )
            .get();
        assertHitCount(searchResponse, 10);
        Terms terms = searchResponse.getAggregations().get("terms");
        assertThat(terms, notNullValue());
        List<? extends Terms.Bucket> buckets = terms.getBuckets();