From a9f5c1d68de76e9d9d98c93923ad6af7246ec5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Nag=C3=B3rski?= Date: Fri, 14 Apr 2023 08:49:52 +0200 Subject: [PATCH] Update CountdownEventTest.cs --- src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();