### CI Link

https://gradle-enterprise.elastic.co/s/ou2sap2dhy3q2/tests/:server:internalClusterTest/org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT/testDataFileFailureDuringSnapshot

### Repro line

./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT.testDataFileFailureDuringSnapshot" -Dtests.seed=37B64CEE1DCEACEB -Dtests.locale=uk -Dtests.timezone=Africa/Lusaka -Druntime.java=17

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

```
java.lang.Exception: Test abandoned because suite timeout was reached. 
    at __randomizedtesting.SeedInfo.seed([37B64CEE1DCEACEB]:0)
```
server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java
writeIndexGen(repository, repositoryData, repositoryData.getGenId());
        assertEquals(ESBlobStoreRepositoryIntegTestCase.getRepositoryData(repository), repositoryData);
        assertThat(repository.latestIndexBlobId(), equalTo(expectedGeneration + 1L));
        assertThat(repository.readSnapshotIndexLatestBlob(), equalTo(expectedGeneration + 1L));
        
        repositoryData = ESBlobStoreRepositoryIntegTestCase.getRepositoryData(repository)
            .removeSnapshots(Collections.singleton(repositoryData.getSnapshotIds().iterator().next()), ShardGenerations.EMPTY);
        writeIndexGen(repository, repositoryData, repositoryData.getGenId());
        assertEquals(ESBlobStoreRepositoryIntegTestCase.getRepositoryData(repository), repositoryData);
        assertThat(repository.latestIndexBlobId(), equalTo(expectedGeneration + 2L));
        assertThat(repository.readSnapshotIndexLatestBlob(), equalTo(expectedGeneration + 2L));
    }
    public void testCorruptIndexLatestFile() throws Exception {
        final BlobStoreRepository repository = setupRepo();
        final long generation = randomLong();
        final byte[] generationBytes = Numbers.longToBytes(generation);
        final byte[] buffer = new byte[16];
        System.arraycopy(generationBytes, 0, buffer, 0, 8);
        for (int i = 0; i < 16; i++) {
            repository.blobContainer().writeBlob(BlobStoreRepository.INDEX_LATEST_BLOB, new BytesArray(buffer, 0, i), false);
            if (i == 8) {
                assertThat(repository.readSnapshotIndexLatestBlob(), equalTo(generation));
            } else {
                assertThat(
                    expectThrows(RepositoryException.class, repository::readSnapshotIndexLatestBlob).getMessage(),
                    allOf(
                        containsString("exception reading blob [index.latest]: expected 8 bytes"),
                        i < 8 ? containsString("blob was " + i + " bytes") : containsString("blob was longer")
                    )
                );