2222import org .elasticsearch .common .util .concurrent .EsExecutors ;
2323import org .elasticsearch .index .IndexNotFoundException ;
2424import org .elasticsearch .indices .IndicesService ;
25- import org .elasticsearch .plugins .Plugin ;
2625import org .elasticsearch .plugins .PluginsService ;
2726import org .elasticsearch .telemetry .TestTelemetryPlugin ;
2827import org .elasticsearch .test .ESIntegTestCase ;
2928import org .elasticsearch .threadpool .ThreadPool ;
3029import org .junit .BeforeClass ;
3130
32- import java .util .ArrayList ;
33- import java .util .Collection ;
3431import java .util .List ;
3532import java .util .Locale ;
3633import java .util .stream .IntStream ;
@@ -53,13 +50,6 @@ public static void setAvailableDiskSpaceBufferLimit() {
5350 MERGE_DISK_HIGH_WATERMARK_BYTES = randomLongBetween (10_000_000L , 20_000_000L );
5451 }
5552
56- @ Override
57- protected Collection <Class <? extends Plugin >> nodePlugins () {
58- List <Class <? extends Plugin >> nodePluginsList = new ArrayList <>(super .nodePlugins ());
59- nodePluginsList .add (TestTelemetryPlugin .class );
60- return nodePluginsList ;
61- }
62-
6353 @ Override
6454 protected Settings nodeSettings (int nodeOrdinal , Settings otherSettings ) {
6555 return Settings .builder ()
@@ -217,17 +207,6 @@ public void testForceMergeIsBlockedThenUnblocked() throws Exception {
217207 // merge executor says merging is blocked due to insufficient disk space while there is a single merge task enqueued
218208 assertThat (threadPoolMergeExecutorService .getMergeTasksQueueLength (), equalTo (1 ));
219209 assertTrue (threadPoolMergeExecutorService .isMergingBlockedDueToInsufficientDiskSpace ());
220- // telemetry says that there are indeed some segments enqueued to be merged
221- testTelemetryPlugin .collect ();
222- assertThat (
223- testTelemetryPlugin .getLongGaugeMeasurement (MergeMetrics .MERGE_SEGMENTS_QUEUED_USAGE ).getLast ().getLong (),
224- greaterThan (0L )
225- );
226- // but still no merges are currently running
227- assertThat (
228- testTelemetryPlugin .getLongGaugeMeasurement (MergeMetrics .MERGE_SEGMENTS_RUNNING_USAGE ).getLast ().getLong (),
229- equalTo (0L )
230- );
231210 // indices stats also says that no merge is currently running (blocked merges are NOT considered as "running")
232211 IndicesStatsResponse indicesStatsResponse = client ().admin ().indices ().prepareStats (indexName ).setMerge (true ).get ();
233212 long currentMergeCount = indicesStatsResponse .getIndices ().get (indexName ).getPrimaries ().merge .getCurrent ();
@@ -253,12 +232,9 @@ public void testForceMergeIsBlockedThenUnblocked() throws Exception {
253232 // assert index stats and telemetry report no merging in progress (after force merge returned)
254233 long currentMergeCount = indicesStatsResponse .getIndices ().get (indexName ).getPrimaries ().merge .getCurrent ();
255234 assertThat (currentMergeCount , equalTo (0L ));
256- assertThat (testTelemetryPlugin .getLongGaugeMeasurement (MergeMetrics .MERGE_SEGMENTS_QUEUED_USAGE ).getLast ().getLong (), equalTo (0L ));
257- assertThat (testTelemetryPlugin .getLongGaugeMeasurement (MergeMetrics .MERGE_SEGMENTS_RUNNING_USAGE ).getLast ().getLong (), equalTo (0L ));
258235 // but some merging took place (there might have been other merges automatically triggered before the force merge call)
259236 long totalMergeCount = indicesStatsResponse .getIndices ().get (indexName ).getPrimaries ().merge .getTotal ();
260237 assertThat (totalMergeCount , greaterThan (0L ));
261- assertThat (testTelemetryPlugin .getLongCounterMeasurement (MergeMetrics .MERGE_DOCS_TOTAL ).getLast ().getLong (), greaterThan (0L ));
262238 // assert there's a single segment after the force merge
263239 List <ShardSegments > shardSegments = getShardSegments (indexName );
264240 assertThat (shardSegments .size (), equalTo (1 ));
0 commit comments