@@ -499,7 +499,6 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
499499 final var indexName = randomIdentifier ();
500500 createIndexWithContent (indexName , indexSettings (numShards , 0 ).put (REQUIRE_NODE_NAME_SETTING , nodeForRemoval ).build ());
501501 indexAllShardsToAnEqualOrGreaterMinimumSize (indexName , ByteSizeValue .of (2 , ByteSizeUnit .KB ).getBytes ());
502- logger .info ("---> nodeForRemovalId: " + nodeForRemovalId + ", numShards: " + numShards );
503502
504503 // Start the snapshot with blocking in place on the data node not to allow shard snapshots to finish yet.
505504 final var clusterService = internalCluster ().getCurrentMasterNodeInstance (ClusterService .class );
@@ -509,21 +508,7 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
509508
510509 waitForBlock (otherNode , repoName );
511510
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-
511+ logger .info ("---> nodeForRemovalId: " + nodeForRemovalId + ", numShards: " + numShards );
527512 mockLog .addExpectation (
528513 new MockLog .SeenEventExpectation (
529514 "SnapshotShutdownProgressTracker start log message" ,
@@ -569,6 +554,21 @@ public void testSnapshotShutdownProgressTracker() throws Exception {
569554 mockLog .awaitAllExpectationsMatched ();
570555 resetMockLog ();
571556
557+ // Block on the master when a shard snapshot request comes in, until we can verify that the Tracker saw the outgoing request.
558+ final CountDownLatch snapshotStatusUpdateLatch = new CountDownLatch (1 );
559+ final var masterTransportService = MockTransportService .getInstance (internalCluster ().getMasterName ());
560+ masterTransportService .addRequestHandlingBehavior (
561+ SnapshotsService .UPDATE_SNAPSHOT_STATUS_ACTION_NAME ,
562+ (handler , request , channel , task ) -> masterTransportService .getThreadPool ().generic ().execute (() -> {
563+ safeAwait (snapshotStatusUpdateLatch );
564+ try {
565+ handler .messageReceived (request , channel , task );
566+ } catch (Exception e ) {
567+ fail (e );
568+ }
569+ })
570+ );
571+
572572 mockLog .addExpectation (
573573 new MockLog .SeenEventExpectation (
574574 "SnapshotShutdownProgressTracker shard snapshot has paused log message" ,
0 commit comments