vamossagar12 commented on code in PR #12802:
URL: https://github.com/apache/kafka/pull/12802#discussion_r1055576373


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java:
##########
@@ -3629,6 +3630,64 @@ public void testPollDurationOnSlowConnectorOperations() {
         PowerMock.verifyAll();
     }
 
+    @Test(expected = RejectedExecutionException.class)
+    @SuppressWarnings("unchecked")
+    public void 
shouldThrowWhenStartAndStopExecutorThrowsRejectedExecutionExceptionAndHerderNotStopping()
 throws InterruptedException {
+        ExecutorService startAndStopExecutor = 
EasyMock.mock(ExecutorService.class);
+        herder.startAndStopExecutor = startAndStopExecutor;
+
+        Callable<Void> connectorStartingCallable = () -> null;
+
+        
EasyMock.expect(startAndStopExecutor.invokeAll(EasyMock.anyObject(Collection.class))).andThrow(new
 RejectedExecutionException());
+
+        PowerMock.replayAll(startAndStopExecutor);
+
+        
herder.startAndStop(Collections.singletonList(connectorStartingCallable));
+
+    }
+
+    @Test
+    public void 
shouldHaltCleanlyWhenHerderStartsAndStopsAndConfigTopicReadTimesOut() throws 
TimeoutException {

Review Comment:
   yeah I was not totally sure on how to keep invoking the tick `method` 
repeatedly and hence ended up doing something like this. I also agree that it's 
really not too representative of what needs to be tested. I guess removing the 
test might be a better option.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to