This is an automated email from the ASF dual-hosted git repository.

twolf pushed a commit to branch dev_3.0
in repository https://gitbox.apache.org/repos/asf/mina-sshd.git


The following commit(s) were added to refs/heads/dev_3.0 by this push:
     new 2a13d8ccb Fix test
2a13d8ccb is described below

commit 2a13d8ccb2ad8927601f990aa991a3d6e9a58a8b
Author: Thomas Wolf <[email protected]>
AuthorDate: Sun Oct 12 00:45:51 2025 +0200

    Fix test
---
 .../test/java/org/apache/sshd/common/kex/extension/StrictKexTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/sshd-core/src/test/java/org/apache/sshd/common/kex/extension/StrictKexTest.java
 
b/sshd-core/src/test/java/org/apache/sshd/common/kex/extension/StrictKexTest.java
index f0d860008..76c666877 100644
--- 
a/sshd-core/src/test/java/org/apache/sshd/common/kex/extension/StrictKexTest.java
+++ 
b/sshd-core/src/test/java/org/apache/sshd/common/kex/extension/StrictKexTest.java
@@ -113,11 +113,11 @@ class StrictKexTest extends BaseTestSupport {
         } catch (SshException e) {
             IoWriteFuture future = debugMsg.get();
             assertNotNull(future, "No SSH_MSG_DEBUG");
-            assertTrue(future.isWritten(), "SSH_MSG_DEBUG should have been 
sent");
             // Due to a race condition in the Nio2 transport when closing a 
connection due to an exception it's possible
             // that we do _not_ get the expected disconnection code. The race 
condition may lead to the IoSession being
             // closed in the peer before it has sent the DISCONNECT message. 
Happens in particular on Windows.
             if (e.getDisconnectCode() == 
SshConstants.SSH2_DISCONNECT_KEY_EXCHANGE_FAILED) {
+                assertTrue(future.isWritten(), "SSH_MSG_DEBUG should have been 
sent");
                 assertTrue(e.getMessage()
                         .startsWith("KEX: strict KEX negotiated but there were 
1 messages before the first SSH_MSG_KEXINIT"),
                         "Unexpected disconnect reason: " + e.getMessage());
@@ -162,8 +162,8 @@ class StrictKexTest extends BaseTestSupport {
         } catch (SshException e) {
             IoWriteFuture future = debugMsg.get();
             assertNotNull(future, "No SSH_MSG_DEBUG");
-            assertTrue(future.isWritten(), "SSH_MSG_DEBUG should have been 
sent");
             if (e.getDisconnectCode() == 
SshConstants.SSH2_DISCONNECT_KEY_EXCHANGE_FAILED) {
+                assertTrue(future.isWritten(), "SSH_MSG_DEBUG should have been 
sent");
                 assertEquals("SSH_MSG_DEBUG not allowed during initial key 
exchange in strict KEX", e.getMessage(),
                         "Unexpected disconnect reason");
             }

Reply via email to