Skip to content

Commit 548247f

Browse files
committed
[Test] Fix SnapshotMetricsIT testByStateCounts_InitAndQueuedShards
Ensure new cluster state with init shards is visble to master before assertions. Resolves: #134089
1 parent 2bc5498 commit 548247f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/internalClusterTest/java/org/elasticsearch/repositories/SnapshotMetricsIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.repositories;
1111

1212
import org.elasticsearch.action.ActionFuture;
13+
import org.elasticsearch.action.ActionListener;
1314
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
1415
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
1516
import org.elasticsearch.cluster.SnapshotsInProgress;
@@ -318,6 +319,9 @@ public void testByStateCounts_InitAndQueuedShards() throws Exception {
318319
.execute();
319320

320321
waitForBlockOnAnyDataNode(repositoryName);
322+
safeAwait(
323+
(ActionListener<Void> l) -> flushMasterQueue(internalCluster().getCurrentMasterNodeInstance(ClusterService.class), l)
324+
);
321325

322326
// Should be {numShards} in INIT state, and 1 STARTED snapshot
323327
Map<SnapshotsInProgress.ShardState, Long> shardStates = getShardStates();

0 commit comments

Comments
 (0)