lianetm commented on code in PR #17440:
URL: https://github.com/apache/kafka/pull/17440#discussion_r1875232483


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/NetworkClientDelegateTest.java:
##########
@@ -212,9 +213,27 @@ public void testPropagateMetadataError() {
         AuthenticationException authException = new 
AuthenticationException("Test Auth Exception");
         doThrow(authException).when(metadata).maybeThrowAnyException();
 
+        NetworkClientDelegate networkClientDelegate = 
newNetworkClientDelegate(false);
+        assertTrue(networkClientDelegate.getAndClearMetadataError().isEmpty());
+        networkClientDelegate.poll(0, time.milliseconds());
+        
+        
assertTrue(networkClientDelegate.getAndClearMetadataError().isPresent());

Review Comment:
   this will clear the error so the assertions within the ifPresent will never 
run right? (maybe we take the Optional result of .getAndClear, check that 
optional is present, and then the 2 asserts on the value?)



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