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


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThreadTest.java:
##########
@@ -149,20 +164,28 @@ public void testStartupAndTearDown() throws 
InterruptedException {
                 "The consumer network thread did not stop within " + 
DEFAULT_MAX_WAIT_MS + " ms");
     }
 
+    @Test
+    void testRequestManagersArePolledOnce() {
+        consumerNetworkThread.runOnce();
+        requestManagers.entries().forEach(rmo -> rmo.ifPresent(rm -> 
verify(rm, times(1)).poll(anyLong())));
+        requestManagers.entries().forEach(rmo -> rmo.ifPresent(rm -> 
verify(rm, times(1)).maximumTimeToWait(anyLong())));
+        verify(networkClientDelegate).poll(anyLong(), anyLong());
+    }
+
     @Test
     public void testApplicationEvent() {
         ApplicationEvent e = new PollEvent(100);
         applicationEventsQueue.add(e);
         consumerNetworkThread.runOnce();
-        verify(applicationEventProcessor, times(1)).process(e);
+        verify(applicationEventProcessor).process(e);
     }
 
     @Test
     public void testMetadataUpdateEvent() {

Review Comment:
   i think can probably remove this teset as it is doing exactly the same thing 
as `testApplicationEvent`.  We should probably try to find a similar test to 
ensure the code path is covered.



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