diff --git a/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs b/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs index 23330f8b5..12ed7a081 100644 --- a/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs +++ b/src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs @@ -334,7 +334,10 @@ public void WaitHandle_WaitOne_ShouldReturnFalseWhenTimeoutExpiresBeforeCountdow Assert.IsFalse(actual); Assert.IsFalse(countdownEvent.IsSet); Assert.IsFalse(countdownEvent.WaitHandle.WaitOne(0)); - 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();