diff --git a/x-pack/plugin/snapshot-based-recoveries/src/internalClusterTest/java/org/elasticsearch/xpack/snapshotbasedrecoveries/recovery/SnapshotBasedIndexRecoveryIT.java b/x-pack/plugin/snapshot-based-recoveries/src/internalClusterTest/java/org/elasticsearch/xpack/snapshotbasedrecoveries/recovery/SnapshotBasedIndexRecoveryIT.java index 6ae332c0691ce..a76cc2c6018c7 100644 --- a/x-pack/plugin/snapshot-based-recoveries/src/internalClusterTest/java/org/elasticsearch/xpack/snapshotbasedrecoveries/recovery/SnapshotBasedIndexRecoveryIT.java +++ b/x-pack/plugin/snapshot-based-recoveries/src/internalClusterTest/java/org/elasticsearch/xpack/snapshotbasedrecoveries/recovery/SnapshotBasedIndexRecoveryIT.java @@ -73,6 +73,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -787,7 +788,6 @@ public void testRecoveryConcurrentlyWithIndexing() throws Exception { assertDocumentsAreEqual(indexName, numDocs.get()); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/79455") public void testSeqNoBasedRecoveryIsUsedAfterPrimaryFailOver() throws Exception { List dataNodes = internalCluster().startDataOnlyNodes(3); String indexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT); @@ -1391,8 +1391,10 @@ private RecoveryState getLatestPeerRecoveryStateForShard(String indexName, int s assertThat(indexRecoveries, notNullValue()); List peerRecoveries = indexRecoveries.stream() + .filter(recoveryState -> recoveryState.getStage() == RecoveryState.Stage.DONE) .filter(recoveryState -> recoveryState.getRecoverySource().equals(RecoverySource.PeerRecoverySource.INSTANCE)) .filter(recoveryState -> recoveryState.getShardId().getId() == shardId) + .sorted(Comparator.comparingLong(o -> o.getTimer().stopTime())) .collect(Collectors.toList()); assertThat(peerRecoveries, is(not(empty())));