diff --git a/TUnit.Assertions.Tests/WaitsForAssertionTests.cs b/TUnit.Assertions.Tests/WaitsForAssertionTests.cs index e84417729c..4c0c3e51f2 100644 --- a/TUnit.Assertions.Tests/WaitsForAssertionTests.cs +++ b/TUnit.Assertions.Tests/WaitsForAssertionTests.cs @@ -56,8 +56,10 @@ public async Task WaitsFor_Fails_When_Timeout_Expires() stopwatch.Stop(); - // Verify timeout was respected (should be close to 100ms, not significantly longer) - await Assert.That(stopwatch.Elapsed).IsLessThan(TimeSpan.FromSeconds(1)); + // Lower bound proves the timeout actually fired at the right moment. An upper bound + // here is a flake magnet — slow CI workers can spend >1s in exception construction + // and assertion-machinery cost after the timeout fires correctly. + await Assert.That(stopwatch.Elapsed).IsGreaterThanOrEqualTo(TimeSpan.FromMilliseconds(100)); // Verify error message contains useful information await Assert.That(exception.Message).Contains("assertion did not pass within 100ms");