mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 09:15:47 +00:00
fix flaky ReceiveOnServerSocketShouldReturnZero test (#1404)
* fix flaky ReceiveOnServerSocketShouldReturnZero test ReceiveOnServerSocketShouldReturnZero assumed that the disconnect already happened on the server side, but it never waits for this. This could cause ServerSocket.Receive to still return valid data and fail the test. example: https://ci.appveyor.com/project/drieseng/ssh-net/builds/49836561/job/wen5tjd1c7wgxrfh * Update test/Renci.SshNet.Tests/Classes/SessionTest_Connected_Disconnect.cs --------- Co-authored-by: Rob Hague <rob.hague00@gmail.com>
This commit is contained in:
@@ -15,7 +15,10 @@ namespace Renci.SshNet.Tests.Classes
|
||||
{
|
||||
protected override void Act()
|
||||
{
|
||||
using ManualResetEventSlim clientDisconnected = new ManualResetEventSlim(false);
|
||||
ServerListener.Disconnected += (socket) => clientDisconnected.Set();
|
||||
Session.Disconnect();
|
||||
clientDisconnected.Wait(10000);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
Reference in New Issue
Block a user