@@ -516,7 +516,7 @@ public void testSchedulerCloseWaitsForRunningMerge() throws Exception {
516516 IndexSettingsModule .newIndexSettings ("index" , settings ),
517517 threadPoolMergeExecutorService ,
518518 merge -> 0 ,
519- mock ( MergeMetrics .class )
519+ MergeMetrics .NOOP
520520 )
521521 ) {
522522 CountDownLatch mergeDoneLatch = new CountDownLatch (1 );
@@ -580,7 +580,6 @@ public void testAutoIOThrottleForMergeTasksWhenSchedulerDisablesIt() throws Exce
580580 ThreadPoolMergeExecutorService threadPoolMergeExecutorService = mock (ThreadPoolMergeExecutorService .class );
581581 MergePolicy .OneMergeProgress oneMergeProgress = new MergePolicy .OneMergeProgress ();
582582 OneMerge oneMerge = mock (OneMerge .class );
583- MergeMetrics mergeMetrics = mock (MergeMetrics .class );
584583 when (oneMerge .getStoreMergeInfo ()).thenReturn (getNewMergeInfo (randomNonNegativeLong ()));
585584 when (oneMerge .getMergeProgress ()).thenReturn (oneMergeProgress );
586585 MergeSource mergeSource = mock (MergeSource .class );
@@ -591,7 +590,7 @@ public void testAutoIOThrottleForMergeTasksWhenSchedulerDisablesIt() throws Exce
591590 indexSettings ,
592591 threadPoolMergeExecutorService ,
593592 merge -> 0 ,
594- mergeMetrics
593+ MergeMetrics . NOOP
595594 )
596595 ) {
597596 threadPoolMergeScheduler .merge (mergeSource , randomFrom (MergeTrigger .values ()));
@@ -610,7 +609,6 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
610609 IndexSettings indexSettings = IndexSettingsModule .newIndexSettings ("index" , settingsBuilder .build ());
611610 MergePolicy .OneMergeProgress oneMergeProgress = new MergePolicy .OneMergeProgress ();
612611 OneMerge oneMerge = mock (OneMerge .class );
613- MergeMetrics mergeMetrics = mock (MergeMetrics .class );
614612 // forced merge with a set number of segments
615613 when (oneMerge .getStoreMergeInfo ()).thenReturn (getNewMergeInfo (randomNonNegativeLong (), randomNonNegativeInt ()));
616614 when (oneMerge .getMergeProgress ()).thenReturn (oneMergeProgress );
@@ -623,7 +621,7 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
623621 indexSettings ,
624622 threadPoolMergeExecutorService ,
625623 merge -> 0 ,
626- mergeMetrics
624+ MergeMetrics . NOOP
627625 )
628626 ) {
629627 threadPoolMergeScheduler .merge (mergeSource , randomFrom (MergeTrigger .values ()));
@@ -641,7 +639,7 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
641639 indexSettings ,
642640 threadPoolMergeExecutorService ,
643641 merge -> 0 ,
644- mergeMetrics
642+ MergeMetrics . NOOP
645643 )
646644 ) {
647645 // merge submitted upon closing
@@ -659,7 +657,7 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
659657 indexSettings ,
660658 threadPoolMergeExecutorService ,
661659 merge -> 0 ,
662- mergeMetrics
660+ MergeMetrics . NOOP
663661 )
664662 ) {
665663 // merge submitted upon closing
@@ -676,14 +674,13 @@ public void testAutoIOThrottleForMergeTasks() throws Exception {
676674
677675 public void testMergeSchedulerAbortsMergeWhenShouldSkipMergeIsTrue () {
678676 ThreadPoolMergeExecutorService threadPoolMergeExecutorService = mock (ThreadPoolMergeExecutorService .class );
679- MergeMetrics mergeMetrics = mock (MergeMetrics .class );
680677 // build a scheduler that always returns true for shouldSkipMerge
681678 ThreadPoolMergeScheduler threadPoolMergeScheduler = new ThreadPoolMergeScheduler (
682679 new ShardId ("index" , "_na_" , 1 ),
683680 IndexSettingsModule .newIndexSettings ("index" , Settings .builder ().build ()),
684681 threadPoolMergeExecutorService ,
685682 merge -> 0 ,
686- mergeMetrics
683+ MergeMetrics . NOOP
687684 ) {
688685 @ Override
689686 protected boolean shouldSkipMerge () {
0 commit comments