diff --git a/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs b/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs index 7dceffc7e..23330f8b5 100644 --- a/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs +++ b/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs @@ -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();