mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-10-17 05:21:15 +08:00
make ConnectShouldActivateKeepAliveIfSessionIs test less flaky (#1410)
* make ConnectShouldActivateKeepAliveIfSessionIs test less flaky wait longer and expect at least two instead of exactly two. example: https://ci.appveyor.com/project/drieseng/ssh-net/builds/49849877/job/9rrtw6j8eu3i5p8o?fullLog=true * fix net462 build
This commit is contained in:
+4
-4
@@ -69,11 +69,11 @@ namespace Renci.SshNet.Tests.Classes
|
||||
|
||||
_client.Connect();
|
||||
|
||||
// allow keep-alive to be sent twice
|
||||
Thread.Sleep(250);
|
||||
// allow keep-alive to be sent at least twice with some margin for error
|
||||
Thread.Sleep(5 * (int)_keepAliveInterval.TotalMilliseconds);
|
||||
|
||||
// Exactly two keep-alives should be sent
|
||||
SessionMock.Verify(p => p.TrySendMessage(It.IsAny<IgnoreMessage>()), Times.Exactly(2));
|
||||
// At least two keep-alives should be sent
|
||||
SessionMock.Verify(p => p.TrySendMessage(It.IsAny<IgnoreMessage>()), Times.AtLeast(2));
|
||||
}
|
||||
|
||||
private class MyClient : BaseClient
|
||||
|
||||
Reference in New Issue
Block a user