From 4eb5a17d0c6dca30e1a76e34bee288f703904c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Breu=C3=9F=20Valentin?= Date: Mon, 23 Feb 2026 07:06:15 +0100 Subject: [PATCH] tests: add tolerance to `Stopwatch` test --- Tests/Testably.Abstractions.Tests/TimeSystem/StopwatchTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/Testably.Abstractions.Tests/TimeSystem/StopwatchTests.cs b/Tests/Testably.Abstractions.Tests/TimeSystem/StopwatchTests.cs index 7addd072..6caedc02 100644 --- a/Tests/Testably.Abstractions.Tests/TimeSystem/StopwatchTests.cs +++ b/Tests/Testably.Abstractions.Tests/TimeSystem/StopwatchTests.cs @@ -136,7 +136,8 @@ public async Task Stop_ShouldSetIsRunningToFalse() stopwatch.Stop(); TimeSpan elapsed = stopwatch.Elapsed; - await That(elapsed.TotalMilliseconds).IsGreaterThanOrEqualTo(100); + // Allow one millisecond tolerance due to potential rounding issues. + await That(elapsed.TotalMilliseconds).IsGreaterThanOrEqualTo(99); await That(stopwatch.IsRunning).IsFalse(); }