Skip to content

Commit fe5ed42

Browse files
mus65Rob-Hague
andauthored
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 <[email protected]>
1 parent c0a353a commit fe5ed42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/Renci.SshNet.IntegrationTests/ConnectivityTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public void Common_DetectConnectionResetThroughSftpInvocation()
171171

172172
try
173173
{
174+
WaitForConnectionInterruption(client);
174175
client.ListDirectory("/");
175176
Assert.Fail();
176177
}
@@ -260,9 +261,9 @@ public void Common_DetectLossOfNetworkConnectivityThroughSftpInvocation()
260261
client.Connect();
261262

262263
var disruptor = _sshConnectionDisruptor.BreakConnections();
263-
Thread.Sleep(100);
264264
try
265265
{
266+
WaitForConnectionInterruption(client);
266267
client.ListDirectory("/");
267268
Assert.Fail();
268269
}

0 commit comments

Comments
 (0)