You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/16 12:17:54 UTC

[GitHub] [kafka] divijvaidya commented on a diff in pull request #12159: Fix stuck SSL tests in case of authentication failure

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


##########
clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java:
##########
@@ -449,9 +450,9 @@ public void close() {
     @Test
     public void testCloseOldestConnection() throws Exception {
         String id = "0";
-        blockingConnect(id);
-
-        time.sleep(6000); // The max idle time is 5000ms
+        selector.connect(id, new InetSocketAddress("localhost", server.port), BUFFER_SIZE, BUFFER_SIZE);
+        selector.poll(0);

Review Comment:
   Note that `connect()` is synchronous method here. It might not complete with the first poll event. That is the reason it is tested in a while loop inside `blockingConnect`.
   
   My suggestion would be to keep using blockingConnect with a (new) timeout to terminate while loop in it similar to implementation of `NetworkTestUtils.waitForChannelReady`.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org