diff --git a/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs b/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs index 15451b1ef..16b80e161 100644 --- a/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs +++ b/test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs @@ -171,6 +171,7 @@ public void Common_DetectConnectionResetThroughSftpInvocation() try { + WaitForConnectionInterruption(client); client.ListDirectory("/"); Assert.Fail(); } @@ -260,9 +261,9 @@ public void Common_DetectLossOfNetworkConnectivityThroughSftpInvocation() client.Connect(); var disruptor = _sshConnectionDisruptor.BreakConnections(); - Thread.Sleep(100); try { + WaitForConnectionInterruption(client); client.ListDirectory("/"); Assert.Fail(); }