diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java index c41fc68e3fe..3ccc53f4c65 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java @@ -1388,9 +1388,10 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest public void clusterChanged(ClusterChangedEvent event) { final SnapshotsInProgress snapshotsInProgress = event.state().custom(SnapshotsInProgress.TYPE); if (snapshotsInProgress != null && snapshotsInProgress.entries().stream() - .anyMatch(entry -> entry.state() == SnapshotsInProgress.State.ABORTED)) - abortVisibleFuture.onResponse(null); - clusterService.removeListener(this); + .anyMatch(entry -> entry.state() == SnapshotsInProgress.State.ABORTED)) { + abortVisibleFuture.onResponse(null); + clusterService.removeListener(this); + } } });