brenden20 commented on code in PR #16373:
URL: https://github.com/apache/kafka/pull/16373#discussion_r1686746058


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java:
##########
@@ -153,6 +154,35 @@ public void cleanup() {
         }
     }
 
+    @Test
+    public void testHeartBeatRequestStateToStringBase() {
+        long retryBackoffMs = 100;
+        long retryBackoffMaxMs = 1000;
+        LogContext logContext = new LogContext();
+        HeartbeatRequestState heartbeatRequestState = new 
HeartbeatRequestState(
+                logContext,
+                time,
+                DEFAULT_HEARTBEAT_INTERVAL_MS,
+                retryBackoffMs,
+                retryBackoffMaxMs,
+                .2
+        );
+
+        RequestState requestState = new RequestState(
+                logContext,
+                HeartbeatRequestManager.HeartbeatRequestState.class.getName(),
+                retryBackoffMs,
+                retryBackoffMaxMs
+        );
+
+        String target = requestState.toStringBase() +
+                ", remainingMs=" + 
heartbeatRequestState.heartbeatTimer().remainingMs() +

Review Comment:
   I see your point, I have updated the test now. Since we compute `target` 
right after creating a `RequestState`, I thought for the test it would be 
appropriate to hard-code `remainingMs` to be equal to 
`DEFAULT_HEARTBEAT_INTERVAL_MS`. I have also removed the `heartbeatTimer()` 
method.



-- 
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