### 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)
```
test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java
.map(expectedWarning -> new DeprecationWarning(DeprecationLogger.CRITICAL, expectedWarning))
                .toArray(DeprecationWarning[]::new)
        );
    }
    protected final void assertWarnings(boolean stripXContentPosition, DeprecationWarning... expectedWarnings) {
        if (enableWarningsCheck() == false) {
            throw new IllegalStateException("unable to check warning headers if the test is not set to do so");
        }
        try {
            final List<String> actualWarningStrings = threadContext.getResponseHeaders().get("Warning");
            if (expectedWarnings == null || expectedWarnings.length == 0) {
                assertNull("expected 0 warnings, actual: " + actualWarningStrings, actualWarningStrings);
            } else {
                assertNotNull("no warnings, expected: " + Arrays.asList(expectedWarnings), actualWarningStrings);
                final Set<DeprecationWarning> actualDeprecationWarnings = actualWarningStrings.stream().map(warningString -> {
                    String warningText = HeaderWarning.extractWarningValueFromWarningHeader(warningString, stripXContentPosition);
                    final Level level;
                    if (warningString.startsWith(Integer.toString(DeprecationLogger.CRITICAL.intLevel()))) {
                        level = DeprecationLogger.CRITICAL;
                    } else if (warningString.startsWith(Integer.toString(Level.WARN.intLevel()))) {
                        level = Level.WARN;
                    } else {
                        throw new IllegalArgumentException("Unknown level in deprecation message " + warningString);
                    }
                    return new DeprecationWarning(level, warningText);
                }).collect(Collectors.toSet());
                for (DeprecationWarning expectedWarning : expectedWarnings) {
                    DeprecationWarning escapedExpectedWarning = new DeprecationWarning(
                        expectedWarning.level,
                        HeaderWarning.escapeAndEncode(expectedWarning.message)