gortiz commented on code in PR #11205:
URL: https://github.com/apache/pinot/pull/11205#discussion_r1277780780
##########
pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/executor/OpChainSchedulerServiceTest.java:
##########
@@ -203,84 +143,72 @@ public void
shouldCallCancelOnOperatorsThatReturnErrorBlock()
return null;
}).when(_operatorA).cancel(Mockito.any());
- schedulerService.startAsync().awaitRunning();
schedulerService.register(opChain);
Assert.assertTrue(latch.await(10, TimeUnit.SECONDS), "expected await to be
called in less than 10 seconds");
- schedulerService.stopAsync().awaitTerminated();
}
- @Test
- public void shouldCallCancelOnOpChainsWhenItIsCancelledByDispatch()
- throws InterruptedException {
- initExecutor(1);
- OpChain opChain = getChain(_operatorA);
- Mockito.when(_scheduler.next(Mockito.anyLong(),
Mockito.any())).thenAnswer((Answer<OpChain>) invocation -> {
- Thread.sleep(100);
- return opChain;
- });
- OpChainSchedulerService schedulerService = new
OpChainSchedulerService(_scheduler, _executor);
-
-
Mockito.when(_operatorA.nextBlock()).thenReturn(TransferableBlockUtils.getNoOpTransferableBlock());
-
- CountDownLatch cancelLatch = new CountDownLatch(1);
- Mockito.doAnswer(inv -> {
- cancelLatch.countDown();
- return null;
- }).when(_operatorA).cancel(Mockito.any());
- CountDownLatch deregisterLatch = new CountDownLatch(1);
- Mockito.doAnswer(inv -> {
- deregisterLatch.countDown();
- return null;
- }).when(_scheduler).deregister(Mockito.same(opChain));
- CountDownLatch awaitLatch = new CountDownLatch(1);
- Mockito.doAnswer(inv -> {
- awaitLatch.countDown();
- return null;
- }).when(_scheduler).yield(Mockito.any());
-
- schedulerService.startAsync().awaitRunning();
- schedulerService.register(opChain);
-
- Assert.assertTrue(awaitLatch.await(10, TimeUnit.SECONDS), "expected await
to be called in less than 10 seconds");
-
- // now cancel the request.
- schedulerService.cancel(123);
-
- Assert.assertTrue(cancelLatch.await(10, TimeUnit.SECONDS), "expected
OpChain to be cancelled");
- Assert.assertTrue(deregisterLatch.await(10, TimeUnit.SECONDS), "expected
OpChain to be deregistered");
- Mockito.verify(_operatorA, Mockito.times(1)).cancel(Mockito.any());
- Mockito.verify(_scheduler, Mockito.times(1)).deregister(Mockito.any());
- schedulerService.stopAsync().awaitTerminated();
- }
+// @Test
+// public void shouldCallCancelOnOpChainsWhenItIsCancelledByDispatch()
Review Comment:
I'm not sure if this tets is still needed or makes sense.
--
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]