priyen-stripe commented on code in PR #17198:
URL: https://github.com/apache/pinot/pull/17198#discussion_r2519572598
##########
pinot-spi/src/test/java/org/apache/pinot/spi/executor/HardLimitExecutorTest.java:
##########
@@ -127,4 +130,48 @@ public void testGetMultiStageExecutorHardLimit() {
PinotConfiguration config5 = new PinotConfiguration(configMap5);
assertEquals(HardLimitExecutor.getMultiStageExecutorHardLimit(config5),
-1);
}
+
+ @Test
+ public void testGaugeTracking()
+ throws Exception {
+ AtomicInteger maxGauge = new AtomicInteger(-1);
+ AtomicInteger currentGauge = new AtomicInteger(-1);
+
+ HardLimitExecutor ex = new HardLimitExecutor(2,
Executors.newCachedThreadPool(),
+ QueryThreadExceedStrategy.ERROR,
+ max -> maxGauge.set(max),
+ current -> currentGauge.set(current));
+
+ CyclicBarrier barrier = new CyclicBarrier(3);
+
+ try {
+ assertEquals(maxGauge.get(), 2);
+ assertEquals(currentGauge.get(), 0);
+
+ ex.execute(() -> {
+ try {
+ barrier.await();
+ Thread.sleep(Long.MAX_VALUE);
Review Comment:
the sleep/do nothing just follows the other examples in the test that
already exist
shutdownNow in the finally cleans it up
--
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]