This failure seems related: https://gradle-enterprise.elastic.co/s/hbx32w3mmvsiu/tests/:server:internalClusterTest/org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT/testUnrestorableIndexDuringRestore?top-execution=1

**Build scan:**
https://gradle-enterprise.elastic.co/s/hbx32w3mmvsiu/tests/:server:internalClusterTest/org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT

**Reproduction line:**
```
./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT" -Dtests.seed=52861D7778F38700 -Dtests.locale=en-US -Dtests.timezone=UTC -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT&tests.test=classMethod

**Failure excerpt:**
```
java.lang.Exception: Suite timeout exceeded (>= 1200000 msec).

  at __randomizedtesting.SeedInfo.seed([52861D7778F38700]:0)

```
server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java
private final String uuid;
    private final ActionListener<RestoreSnapshotResponse> listener;
    private final Supplier<ThreadContext.StoredContext> contextSupplier;
    private RestoreClusterStateListener(
        ClusterService clusterService,
        RestoreService.RestoreCompletionResponse response,
        ActionListener<RestoreSnapshotResponse> listener,
        Supplier<ThreadContext.StoredContext> contextSupplier
    ) {
        this.clusterService = clusterService;
        this.uuid = response.getUuid();
        this.listener = listener;
        this.contextSupplier = contextSupplier;
    }
    @Override
    public void clusterChanged(ClusterChangedEvent changedEvent) {
        try (ThreadContext.StoredContext stored = contextSupplier.get()) {
            final RestoreInProgress.Entry prevEntry = restoreInProgress(changedEvent.previousState(), uuid);
            final RestoreInProgress.Entry newEntry = restoreInProgress(changedEvent.state(), uuid);
            if (prevEntry == null) {
                
                
                
                clusterService.removeListener(this);
                listener.onResponse(new RestoreSnapshotResponse((RestoreInfo) null));
            } else if (newEntry == null) {
                clusterService.removeListener(this);
                Map<ShardId, RestoreInProgress.ShardRestoreStatus> shards = prevEntry.shards();
                assert prevEntry.state().completed() : "expected completed snapshot state but was " + prevEntry.state();
                assert RestoreService.completed(shards) : "expected all restore entries to be completed";