lianetm commented on code in PR #16200:
URL: https://github.com/apache/kafka/pull/16200#discussion_r1683363391
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java:
##########
@@ -898,6 +837,30 @@ private HeartbeatRequestManager
createHeartbeatRequestManager(
heartbeatState,
heartbeatRequestState,
backgroundEventHandler,
- metrics);
+ new Metrics());
+ }
+
+ private void mockJoiningMemberData(String instanceId) {
Review Comment:
I realize now that we have to properly set the expected state here because
it is considered when building the request data, to determine if it should be a
full heartbeat or not (HeartbeatRequestManager
[ln#566](https://github.com/apache/kafka/blob/f595802cc752ed01dc74e9ab932209fe25a9d10b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java#L566)),
so I would say that this should include
`when(membershipManager.state()).thenReturn(MemberState.JOINING)`. The test is
probably passing anyways because of the way this func is used (first HB), but
just to be true to how this will happen in real-life scenarios.
--
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]