kirktrue commented on code in PR #15640:
URL: https://github.com/apache/kafka/pull/15640#discussion_r1608875582


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumerTest.java:
##########
@@ -329,6 +334,17 @@ public void testCommitAsyncWithFencedException() {
         
commitEvent.future().completeExceptionally(Errors.FENCED_INSTANCE_ID.exception());
 
         assertThrows(Errors.FENCED_INSTANCE_ID.exception().getClass(), () -> 
consumer.commitAsync());
+
+        // Close the consumer here as we know it will cause a 
FencedInstanceIdException to be thrown.
+        // If we get an error other than the FencedInstanceIdException, we'll 
raise a ruckus.
+        try {
+            consumer.close();
+        } catch (KafkaException e) {
+            assertNotNull(e.getCause());
+            assertInstanceOf(FencedInstanceIdException.class, e.getCause());
+        } finally {
+            consumer = null;
+        }

Review Comment:
   Yes, it turns out that changes made elsewhere have obviated the need for 
this check.



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