lianetm commented on code in PR #16043:
URL: https://github.com/apache/kafka/pull/16043#discussion_r1631473205
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/NetworkClientDelegateTest.java:
##########
@@ -169,14 +180,38 @@ public void testHasAnyPendingRequests() throws Exception {
}
}
+ @Test
+ public void testPropagateMetadataError() {
+ AuthenticationException authException = new
AuthenticationException("Test Auth Exception");
+ doThrow(authException).when(metadata).maybeThrowAnyException();
+
+ LinkedList<BackgroundEvent> backgroundEventQueue = new LinkedList<>();
+ this.backgroundEventHandler = new
BackgroundEventHandler(backgroundEventQueue);
+ NetworkClientDelegate networkClientDelegate =
newNetworkClientDelegate();
+
+ assertEquals(0, backgroundEventQueue.size());
+ networkClientDelegate.poll(0, time.milliseconds());
+ assertEquals(1, backgroundEventQueue.size());
+
+ BackgroundEvent event = backgroundEventQueue.poll();
+ assertNotNull(event);
+ assertEquals(BackgroundEvent.Type.ERROR, event.type());
+ assertEquals(authException, ((ErrorEvent) event).error());
Review Comment:
my bad, you got it (I was probably looking at an old commit?). All good
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]