fvaleri commented on code in PR #12159:
URL: https://github.com/apache/kafka/pull/12159#discussion_r880201978


##########
clients/src/test/java/org/apache/kafka/common/network/NetworkTestUtils.java:
##########
@@ -87,6 +88,16 @@ public static void checkClientConnection(Selector selector, 
String node, int min
         }
     }
 
+    public static void waitForChannelConnected(Selector selector, String node) 
throws IOException {
+        int secondsLeft = 30;
+        while (selector.channel(node) != null
+                && !selector.channel(node).isConnected() && secondsLeft-- > 0) 
{
+            selector.poll(1000L);
+        }
+        assertNotNull(selector.channel(node));
+        assertTrue(selector.channel(node).isConnected());

Review Comment:
   Agreed, thanks.



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