From dd55c7214adaef949934951a340b844c40653071 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 22 Sep 2020 10:04:18 +0200 Subject: [PATCH] Fix testQueuedSnapshotOperationsAndBrokenRepoOnMasterFailOverMultiple (#62713) There's possible retries here that work out if both the snapshot and the delete operation are retried when master shuts down and hits the unlikely case of the retried delete executing before the retried snapshot, making both operations pass. Closes #62686 --- .../org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java index 397c9def6411e..8d5deea11a254 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java @@ -807,7 +807,12 @@ public void testQueuedSnapshotOperationsAndBrokenRepoOnMasterFailOverMultipleRep expectThrows(ElasticsearchException.class, snapshotThree::actionGet); expectThrows(ElasticsearchException.class, snapshotFour::actionGet); assertAcked(deleteFuture.get()); - expectThrows(ElasticsearchException.class, createBlockedSnapshot::actionGet); + try { + createBlockedSnapshot.actionGet(); + } catch (ElasticsearchException ex) { + // Ignored, thrown most of the time but due to retries when shutting down the master could randomly pass when the request is + // retried and gets executed after the above delete + } } public void testMultipleSnapshotsQueuedAfterDelete() throws Exception {