From fe5ed423a069e5a65f6ccc0d5f1488e55f673ba9 Mon Sep 17 00:00:00 2001 From: mus65 Date: Sat, 18 May 2024 14:17:10 +0200 Subject: [PATCH] fix flaky Connectivity Tests (#1403) these two tests were not waiting for the interruption (all other usages of BreakConnections() did). This could cause random failures because e.g. the wrong exception is thrown. example: https://ci.appveyor.com/project/drieseng/ssh-net/builds/49831433/job/4urb0upx63bvxcgu Co-authored-by: Rob Hague --- test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs b/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs index 15451b1e..16b80e16 100644 --- a/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs +++ b/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs @@ -171,6 +171,7 @@ namespace Renci.SshNet.IntegrationTests try { + WaitForConnectionInterruption(client); client.ListDirectory("/"); Assert.Fail(); } @@ -260,9 +261,9 @@ namespace Renci.SshNet.IntegrationTests client.Connect(); var disruptor = _sshConnectionDisruptor.BreakConnections(); - Thread.Sleep(100); try { + WaitForConnectionInterruption(client); client.ListDirectory("/"); Assert.Fail(); }