Skip to content

Commit

Permalink
Update CountdownEventTest.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechNagorski committed Apr 14, 2023
1 parent a8d0533 commit 7b2b39b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ public void Wait_ShouldReturnFalseWhenTimeoutExpiresBeforeCountdownEventIsSet()
Assert.IsFalse(actual);
Assert.IsFalse(countdownEvent.IsSet);
Assert.IsFalse(countdownEvent.WaitHandle.WaitOne(0));

Assert.AreEqual(watch.Elapsed, timeout);
Assert.IsTrue(watch.Elapsed >= timeout);
// Use precision because it fail in CI/CD pipeline on .NET 7. Locally it worked without precision.
// But I think it is not supper important because this is internal .NET implementation.
var precision = TimeSpan.FromMilliseconds(6);
Assert.IsTrue(watch.Elapsed >= timeout.Subtract(precision));

countdownEvent.Wait(Session.InfiniteTimeSpan);
countdownEvent.Dispose();
Expand Down

0 comments on commit 7b2b39b

Please sign in to comment.