You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "philipnee (via GitHub)" <gi...@apache.org> on 2023/02/24 16:19:58 UTC

[GitHub] [kafka] philipnee commented on a diff in pull request #13270: KAFKA-14729: The kafakConsumer pollForFetches(timer) method takes up a lot of cpu due to the abnormal exit of the heartbeat thread

philipnee commented on code in PR #13270:
URL: https://github.com/apache/kafka/pull/13270#discussion_r1117261344


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinatorTest.java:
##########
@@ -1206,10 +1206,21 @@ public void testUncaughtExceptionInHeartbeatThread() throws Exception {
                 throw e;
             return false;
         }, heartbeatResponse(Errors.UNKNOWN_SERVER_ERROR));
+        coordinator.ensureActiveGroup();
+        mockTime.sleep(HEARTBEAT_INTERVAL_MS);
+
+        try {

Review Comment:
   Do you think It could be cleaner to use assertThrows? Something like. In this case we won't need to fail then assertEquals. (And the test message can be more accurate)
   ```
   assertThrows(SadException.class,
           () -> coordinator.sadPath());
   ```



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org