vamossagar12 commented on code in PR #15305: URL: https://github.com/apache/kafka/pull/15305#discussion_r1571147929
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/WorkerCoordinatorTest.java: ########## @@ -533,6 +536,57 @@ public void testSkippingAssignmentFails() { verify(configStorage).snapshot(); } + @Test + public void testPollTimeoutExpiry() throws InterruptedException { + // We will create a new WorkerCoordinator object with a rebalance timeout smaller + // than session timeout. This might not happen in the real world but it makes testing + // easier and the test not flaky. + int smallRebalanceTimeout = 20; + this.rebalanceConfig = new GroupRebalanceConfig(sessionTimeoutMs, + smallRebalanceTimeout, + heartbeatIntervalMs, + groupId, + Optional.empty(), + retryBackoffMs, + retryBackoffMaxMs, + true); + this.coordinator = new WorkerCoordinator(rebalanceConfig, + logContext, + consumerClient, + new Metrics(time), + "consumer" + groupId, + time, + LEADER_URL, + configStorage, + rebalanceListener, + compatibility, + 0); + Review Comment: For the purpose of this test, I create a new coordinator with rebalance timeout lesser than session timeout . As mentioned in the comment, it mayn't happen in the real world, but it makes testing a lot easier. -- 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