Skip to content

Conversation

mus65
Copy link
Contributor

@mus65 mus65 commented Sep 28, 2025

@scott-xu
Copy link
Collaborator

How about adding some filters --filter "Name~EcdhSha2Nist|Name~Gcm|Name~Ecdsa|Name~Tripledes" to speed up the integration test?

@mus65
Copy link
Contributor Author

mus65 commented Sep 28, 2025

I would be OK with that. We could also run these in parallel to the .NET Framework tests.

There is one test failure though, no idea about that one.

 Test method Renci.SshNet.IntegrationTests.ConnectivityTests.Common_CreateMoreChannelsThanMaxSessions threw exception: 
Renci.SshNet.Common.SshException: The pseudo-terminal request was not accepted by the server. Consult the server log for more information.
  Stack Trace:
     at Renci.SshNet.ShellStream..ctor(ISession session, String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, IDictionary`2 terminalModeValues, Int32 bufferSize) in /_/src/Renci.SshNet/ShellStream.cs:line 93
   at Renci.SshNet.ServiceFactory.CreateShellStream(ISession session, String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, IDictionary`2 terminalModeValues, Int32 bufferSize) in /_/src/Renci.SshNet/ServiceFactory.cs:line 180
   at Renci.SshNet.SshClient.CreateShellStream(String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, Int32 bufferSize, IDictionary`2 terminalModeValues) in /_/src/Renci.SshNet/SshClient.cs:line 287
   at Renci.SshNet.SshClient.CreateShellStream(String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, Int32 bufferSize) in /_/src/Renci.SshNet/SshClient.cs:line 279
   at Renci.SshNet.IntegrationTests.ConnectivityTests.Common_CreateMoreChannelsThanMaxSessions() in D:\a\SSH.NET\SSH.NET\test\Renci.SshNet.IntegrationTests\ConnectivityTests.cs:line 47
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

@mus65
Copy link
Contributor Author

mus65 commented Oct 3, 2025

I can reproduce the test failure locally on linux when running the net9.0 tests multiple times against the same SSH server container. Recreating the SSH container fixes it. So this appears to be caused by some left over state in the SSH server from the previous run.

Shouldn't we run these in in separate jobs in CI anyway? Then they would use their own SSH containers and run in parallel which would speed things up significantly.

There is obviously some kind of issue in the tests though either way. I will try to narrow it down further...

@Rob-Hague
Copy link
Collaborator

Yeah, they should be separate legs. Thanks for digging in

mus65 added 2 commits October 3, 2025 13:24
so they run in parallel and we avoid the Common_CreateMoreChannelsThanMaxSessions test failure.
mus65 added a commit to mus65/SSH.NET that referenced this pull request Oct 3, 2025
this fixes a test failure in Common_CreateMoreChannelsThanMaxSessions
when running the tests multiple times against the same SSH server
instance.

see sshnet#1704 (comment)
@mus65
Copy link
Contributor Author

mus65 commented Oct 3, 2025

Opened #1710 to fix the test failure.

mus65 added 2 commits October 3, 2025 20:02
this fixes a test failure in Common_CreateMoreChannelsThanMaxSessions
when running the tests multiple times against the same SSH server
instance.

see sshnet#1704 (comment)
turns out this is caused by DNS resolution taking about
2 seconds on every new connection...
@mus65
Copy link
Contributor Author

mus65 commented Oct 3, 2025

Merged #1710 here because this maybe also causes the Ssh_CreateShellNoTerminal test failure.

I also figured out why the Windows tests are so slow, it's DNS.... e2c0ed2 . Should be done in <15min now.

Copy link
Collaborator

@Rob-Hague Rob-Hague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Rob-Hague Rob-Hague merged commit ebdcb3e into sshnet:develop Oct 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants