github-advanced-security[bot] commented on code in PR #18207:
URL: https://github.com/apache/druid/pull/18207#discussion_r2203814522


##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/KafkaClusterMetricsTest.java:
##########
@@ -307,6 +307,85 @@
     );
   }
 
+  @Test
+  @Timeout(120)
+  public void test_ingestClusterMetrics_compactionSkipsLockedIntervals()
+  {
+    final int maxRowsPerSegment = 500;
+    final int compactedMaxRowsPerSegment = 5000;
+
+    final int taskCount = 2;
+    final int taskDurationMillis = 500;
+    final int taskCompletionTimeoutMillis = 5_000;
+
+    // Submit and start a supervisor
+    final String supervisorId = dataSource + "_supe";
+    final KafkaSupervisorSpec kafkaSupervisorSpec = createKafkaSupervisor(
+        supervisorId,
+        taskCount,
+        taskDurationMillis,
+        taskCompletionTimeoutMillis,
+        maxRowsPerSegment
+    );
+    cluster.callApi().onLeaderOverlord(
+        o -> o.postSupervisor(kafkaSupervisorSpec)
+    );
+
+    // Wait for some segments to be published
+    overlord.latchableEmitter().waitForEvent(
+        event -> event.hasMetricName("segment/txn/success")
+                      .hasDimension(DruidMetrics.DATASOURCE, dataSource)
+    );
+
+    // Enable compaction supervisors on the Overlord
+    final ClusterCompactionConfig originalCompactionConfig = 
cluster.callApi().onLeaderOverlord(
+        OverlordClient::getClusterCompactionConfig
+    );
+
+    final ClusterCompactionConfig updatedCompactionConfig
+        = new ClusterCompactionConfig(1.0, 10, null, true, null);
+    final UpdateResponse updateResponse = cluster.callApi().onLeaderOverlord(
+        o -> o.updateClusterCompactionConfig(updatedCompactionConfig)
+    );
+    Assertions.assertTrue(updateResponse.isSuccess());
+
+    // Submit a compaction supervisor for this datasource
+    final CompactionSupervisorSpec compactionSupervisorSpec = new 
CompactionSupervisorSpec(
+        InlineSchemaDataSourceCompactionConfig
+            .builder()
+            .forDataSource(dataSource)
+            .withSkipOffsetFromLatest(Period.seconds(0))
+            .withMaxRowsPerSegment(compactedMaxRowsPerSegment)

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [Builder.withMaxRowsPerSegment](1) should be avoided because it has 
been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/9412)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to