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
RestoreInfo ri = new RestoreInfo(
                    prevEntry.snapshot().getSnapshotId().getName(),
                    prevEntry.indices(),
                    shards.size(),
                    shards.size() - RestoreService.failedShards(shards)
                );
                RestoreSnapshotResponse response = new RestoreSnapshotResponse(ri);
                logger.debug("restore of [{}] completed", prevEntry.snapshot().getSnapshotId());
                listener.onResponse(response);
            } else {
                
            }
        }
    }
    /**
     * Creates a cluster state listener and registers it with the cluster service. The listener passed as a
     * parameter will be called when the restore is complete.
     */
    public static void createAndRegisterListener(
        ClusterService clusterService,
        RestoreService.RestoreCompletionResponse response,
        ActionListener<RestoreSnapshotResponse> listener,
        ThreadContext threadContext
    ) {
        clusterService.addListener(
            new RestoreClusterStateListener(clusterService, response, listener, threadContext.newRestorableContext(true))
        );
    }
}