lianetm commented on code in PR #15698: URL: https://github.com/apache/kafka/pull/15698#discussion_r1569511540
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java: ########## @@ -231,6 +231,35 @@ public void testTimerNotDue() { assertEquals(Long.MAX_VALUE, result.timeUntilNextPollMs); } + @Test + public void testHeartbeatNotSentIfAnotherOneInFlight() { + mockStableMember(); + time.sleep(DEFAULT_HEARTBEAT_INTERVAL_MS); + + // Heartbeat sent (no response received) + NetworkClientDelegate.PollResult result = heartbeatRequestManager.poll(time.milliseconds()); + assertEquals(1, result.unsentRequests.size()); + NetworkClientDelegate.UnsentRequest inflightReq = result.unsentRequests.get(0); + + result = heartbeatRequestManager.poll(time.milliseconds()); + assertEquals(0, result.unsentRequests.size(), "No heartbeat should be sent while a " + + "previous on in-flight"); Review Comment: Fixed (not nit-picky at all, ugly typo, good catch!) -- 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