tomaswolf commented on code in PR #242:
URL: https://github.com/apache/mina-sshd/pull/242#discussion_r967672989


##########
sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java:
##########
@@ -1530,6 +1532,29 @@ public void testConnectUsingIPv6Address() throws 
IOException {
         }
     }
 
+    @Test // see SSHD-1295
+    public void testConnectTimeout() throws Exception {
+        client.start();
+        try {
+            ConnectFuture future = client.connect(getCurrentTestName(), 
TEST_LOCALHOST, port);
+            try {
+                future.verify(1);
+                fail("Timeout expected");
+            } catch (InterruptedIOException | SshException e) {
+                ClientSession session = null;
+                try {
+                    session = future.verify(CONNECT_TIMEOUT).getSession();
+                } catch (SshException e2) {
+                    assertTrue("Expected a timeout, got " + e2, 
e2.getMessage().contains("timeout"));
+                }
+
+                assertNull("Session should not set since client timeout", 
session);

Review Comment:
   It's a timing issue. When I fetched your change and ran the test the first 
time, it worked locally, but I had debug logging on. When I switched off debug 
logging, it failed for me locally, too.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to