divijvaidya commented on code in PR #12590:
URL: https://github.com/apache/kafka/pull/12590#discussion_r968439103


##########
clients/src/test/java/org/apache/kafka/common/security/authenticator/ClientAuthenticationFailureTest.java:
##########
@@ -90,12 +90,12 @@ public void testConsumerWithInvalidCredentials() {
         props.put(ConsumerConfig.GROUP_ID_CONFIG, "");
         StringDeserializer deserializer = new StringDeserializer();
 
-        try (KafkaConsumer<String, String> consumer = new 
KafkaConsumer<>(props, deserializer, deserializer)) {
-            assertThrows(SaslAuthenticationException.class, () -> {
-                consumer.subscribe(Collections.singleton(topic));
-                consumer.poll(Duration.ofSeconds(10));
-            });
-        }
+        KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props, 
deserializer, deserializer);
+        assertThrows(SaslAuthenticationException.class, () -> {
+            consumer.subscribe(Collections.singleton(topic));
+            consumer.poll(Duration.ofSeconds(10));
+            consumer.close();
+        });

Review Comment:
   I have verified that this change is not needed now (since there are no 
sessions available to close) and hence, `consumer.close()` doesn't send a 
message out. I have reverted change in this test in latest commit.



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