kaisun2000 commented on code in PR #15025:
URL: https://github.com/apache/druid/pull/15025#discussion_r1344802027
##########
server/src/test/java/org/apache/druid/server/metrics/QueryCountStatsMonitorTest.java:
##########
@@ -85,12 +105,45 @@ public void testMonitor()
event -> (String)
event.toMap().get("metric"),
event -> (Long)
event.toMap().get("value")
));
- Assert.assertEquals(5, resultMap.size());
+ Assert.assertEquals(6, resultMap.size());
Assert.assertEquals(1L, (long) resultMap.get("query/success/count"));
Assert.assertEquals(2L, (long) resultMap.get("query/failed/count"));
Assert.assertEquals(3L, (long) resultMap.get("query/interrupted/count"));
Assert.assertEquals(4L, (long) resultMap.get("query/timeout/count"));
Assert.assertEquals(10L, (long) resultMap.get("query/count"));
+ Assert.assertEquals(0, (long) resultMap.get("mergeBuffer/pendingQueries"));
+
+ }
+
+ @Test
+ public void testMonitoringMergeBuffer()
+ {
+ executorService.submit(() -> {
+ mergeBufferPool.takeBatch(10);
+ });
+
+ int count = 0;
+ try {
+ // wait at most 10 secs for the executor thread to block
Review Comment:
added `@Test(timeout = 2_000L)` as suggested.
--
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]