### CI Link

https://gradle-enterprise.elastic.co/s/doijmf2rj77a6/console-log?task=:server:test

### Repro line

./gradlew ':server:test' --tests "org.elasticsearch.index.store.StoreTests.testStoreSizes" -Dtests.seed=BAFF5AE277B58421 -Dtests.locale=en-NZ -Dtests.timezone=America/Yellowknife -Druntime.java=21

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

```
org.elasticsearch.index.store.StoreTests > testStoreSizes FAILED |  
java.lang.AssertionError: |  
Expected: <40L> |  
but: was <0L> |  
at __randomizedtesting.SeedInfo.seed([BAFF5AE277B58421:76B6314660FDF343]: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.index.store.StoreTests.testStoreSizes(StoreTests.java:878)
```

The log also seems to indicate a corrupt index, but I'm not sure if this is expected. It fails reliable with the given repro line (on JDK 20 and 21).
server/src/test/java/org/elasticsearch/index/store/StoreTests.java
import org.elasticsearch.index.IndexVersion;
import org.elasticsearch.index.engine.Engine;
import org.elasticsearch.index.seqno.ReplicationTracker;
import org.elasticsearch.index.seqno.RetentionLease;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.indices.store.TransportNodesListShardStoreMetadata;
import org.elasticsearch.test.DummyShardLock;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.IndexSettingsModule;
import org.hamcrest.Matchers;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.LongUnaryOperator;
import static java.util.Collections.emptyList;
import static java.util.Collections.emptyMap;
import static java.util.Collections.unmodifiableMap;