Skip to content

Commit a9f5c1d

Browse files
Update CountdownEventTest.cs
1 parent 7b2b39b commit a9f5c1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Renci.SshNet.Tests/Classes/Common/CountdownEventTest.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ public void WaitHandle_WaitOne_ShouldReturnFalseWhenTimeoutExpiresBeforeCountdow
334334
Assert.IsFalse(actual);
335335
Assert.IsFalse(countdownEvent.IsSet);
336336
Assert.IsFalse(countdownEvent.WaitHandle.WaitOne(0));
337-
Assert.IsTrue(watch.Elapsed >= timeout);
337+
// Use precision because it fail in CI/CD pipeline on .NET 7. Locally it worked without precision.
338+
// But I think it is not supper important because this is internal .NET implementation.
339+
var precision = TimeSpan.FromMilliseconds(6);
340+
Assert.IsTrue(watch.Elapsed >= timeout.Subtract(precision));
338341

339342
countdownEvent.Wait(Session.InfiniteTimeSpan);
340343
countdownEvent.Dispose();

0 commit comments

Comments
 (0)