m1a2st commented on code in PR #16694: URL: https://github.com/apache/kafka/pull/16694#discussion_r1735417379
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerHeartbeatRequestManagerTest.java: ########## @@ -746,6 +746,51 @@ public void testSendingLeaveGroupHeartbeatWhenPreviousOneInFlight(final short ve NetworkClientDelegate.PollResult pollAgain = heartbeatRequestManager.poll(time.milliseconds()); assertEquals(0, pollAgain.unsentRequests.size()); } + + @ParameterizedTest + @ApiKeyVersionsSource(apiKey = ApiKeys.CONSUMER_GROUP_HEARTBEAT) + public void testConsumerAcksReconciledAssignmentAfterAckLost(final short version) { + String topic = "topic1"; + Set<String> topics = Collections.singleton(topic); + Uuid topicId = Uuid.randomUuid(); + int partition = 0; + Map<Uuid, SortedSet<Integer>> testAssignment = Collections.singletonMap( + topicId, mkSortedSet(partition) + ); + + // complete reconciliation + createHeartbeatStateAndRequestManager(); + when(subscriptions.subscription()).thenReturn(topics); + subscriptions.subscribe(topics, Optional.empty()); + mockReconcilingMemberData(testAssignment); + + // send heartbeat1 to ack assignment tp0 + time.sleep(DEFAULT_HEARTBEAT_INTERVAL_MS); + NetworkClientDelegate.PollResult result = heartbeatRequestManager.poll(time.milliseconds()); + + // HB1 times out + result.unsentRequests.get(0) Review Comment: It is good idea, I will address it. -- 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