Skip to content

Conversation

mus65
Copy link
Contributor

@mus65 mus65 commented Oct 3, 2025

this fixes a test failure in Common_CreateMoreChannelsThanMaxSessions when running the tests multiple times against the same SSH server instance. The failure is specifically triggered by SshTests_TTYDisabled.SetUp() calling PermitTTY(false), but Reset() not setting it back to true.

this was noticed in #1704 (comment) .

To repro, you have to modify InfrastructureFixture.InitializeAsync() to always use the local container instead of setting one up with Testcontainers.

Then run the following. This uses podman, but should in theory also work with docker.

#!/bin/bash -e
podman build -t renci-ssh-tests-server-image -f test/Renci.SshNet.IntegrationTests/Dockerfile test/Renci.SshNet.IntegrationTests/
dotnet build -f net9.0 test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj

podman container rm -f -t 0 sshserver || true
podman run --rm -h renci-ssh-tests-server -d -p 2222:22 --name sshserver renci-ssh-tests-server-image

filter="FullyQualifiedName~ConnectivityTests.Common_CreateMoreChannelsThanMaxSessions|FullyQualifiedName~SshTests_TTYDisabled.Ssh_CreateShellNoTerminal"

dotnet test -f net9.0 --tl:off -v normal --no-build test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj
dotnet test -f net9.0 --tl:off -v normal --no-build test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj

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

Merged this into #1704 because it may fix another test failure there.

@mus65 mus65 closed this Oct 3, 2025
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.

1 participant