Skip to content

Commit 244fd4c

Browse files
authored
[Test] Flush master queue before checking snapshots (elastic#116938) (elastic#122721)
The block-on-data-node returns once the data node begins to process the cluster state update for new snapshot. This is before master can see the chnages. In edge cases, the listener may be completed too early before the master can see the new snapshot. This PR flushes the master queue to ensure the snapshot is visible. Resolves: elastic#116730 (cherry picked from commit 5d9385f) # Conflicts: # muted-tests.yml
1 parent 4b338f8 commit 244fd4c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotShutdownIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public void testRestartNodeDuringSnapshot() throws Exception {
7272

7373
final var clusterService = internalCluster().getCurrentMasterNodeInstance(ClusterService.class);
7474
final var snapshotFuture = startFullSnapshotBlockedOnDataNode(randomIdentifier(), repoName, originalNode);
75+
safeAwait((ActionListener<Void> l) -> flushMasterQueue(clusterService, l));
7576
final var snapshotCompletesWithoutPausingListener = ClusterServiceUtils.addTemporaryStateListener(clusterService, state -> {
7677
final var entriesForRepo = SnapshotsInProgress.get(state).forRepo(repoName);
7778
if (entriesForRepo.isEmpty()) {

0 commit comments

Comments
 (0)