@@ -488,6 +488,7 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
488488 final var otherNode = internalCluster ().startDataOnlyNode ();
489489 final var otherIndex = randomIdentifier ();
490490 createIndexWithContent (otherIndex , indexSettings (numShards , 0 ).put (REQUIRE_NODE_NAME_SETTING , otherNode ).build ());
491+ indexAllShardsToAnEqualOrGreaterMinimumSize (otherIndex , ByteSizeValue .of (2 , ByteSizeUnit .KB ).getBytes ());
491492 blockDataNode (repoName , otherNode );
492493
493494 final var nodeForRemoval = internalCluster ().startDataOnlyNode (
@@ -498,6 +499,7 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
498499 final var indexName = randomIdentifier ();
499500 createIndexWithContent (indexName , indexSettings (numShards , 0 ).put (REQUIRE_NODE_NAME_SETTING , nodeForRemoval ).build ());
500501 indexAllShardsToAnEqualOrGreaterMinimumSize (indexName , ByteSizeValue .of (2 , ByteSizeUnit .KB ).getBytes ());
502+ logger .info ("---> nodeForRemovalId: " + nodeForRemovalId + ", numShards: " + numShards );
501503
502504 // Start the snapshot with blocking in place on the data node not to allow shard snapshots to finish yet.
503505 final var clusterService = internalCluster ().getCurrentMasterNodeInstance (ClusterService .class );
@@ -507,7 +509,21 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
507509
508510 waitForBlock (otherNode , repoName );
509511
510- logger .info ("---> nodeForRemovalId: " + nodeForRemovalId + ", numShards: " + numShards );
512+ // Block on the master when a shard snapshot request comes in, until we can verify that the Tracker saw the outgoing request.
513+ final CountDownLatch snapshotStatusUpdateLatch = new CountDownLatch (1 );
514+ final var masterTransportService = MockTransportService .getInstance (internalCluster ().getMasterName ());
515+ masterTransportService .addRequestHandlingBehavior (
516+ SnapshotsService .UPDATE_SNAPSHOT_STATUS_ACTION_NAME ,
517+ (handler , request , channel , task ) -> masterTransportService .getThreadPool ().generic ().execute (() -> {
518+ safeAwait (snapshotStatusUpdateLatch );
519+ try {
520+ handler .messageReceived (request , channel , task );
521+ } catch (Exception e ) {
522+ fail (e );
523+ }
524+ })
525+ );
526+
511527 mockLog .addExpectation (
512528 new MockLog .SeenEventExpectation (
513529 "SnapshotShutdownProgressTracker start log message" ,
@@ -555,21 +571,6 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
555571 mockLog .awaitAllExpectationsMatched ();
556572 resetMockLog ();
557573
558- // Block on the master when a shard snapshot request comes in, until we can verify that the Tracker saw the outgoing request.
559- final CountDownLatch snapshotStatusUpdateLatch = new CountDownLatch (1 );
560- final var masterTransportService = MockTransportService .getInstance (internalCluster ().getMasterName ());
561- masterTransportService .addRequestHandlingBehavior (
562- SnapshotsService .UPDATE_SNAPSHOT_STATUS_ACTION_NAME ,
563- (handler , request , channel , task ) -> masterTransportService .getThreadPool ().generic ().execute (() -> {
564- safeAwait (snapshotStatusUpdateLatch );
565- try {
566- handler .messageReceived (request , channel , task );
567- } catch (Exception e ) {
568- fail (e );
569- }
570- })
571- );
572-
573574 mockLog .addExpectation (
574575 new MockLog .SeenEventExpectation (
575576 "SnapshotShutdownProgressTracker shard snapshot has paused log message" ,
0 commit comments