onyas commented on code in PR #242:
URL: https://github.com/apache/mina-sshd/pull/242#discussion_r967655211
##########
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:
Thank you. By the way, why does it work locally but fail in GitHub Action?
And need to add the delay operation.
--
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]