Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions TUnit.Assertions.Tests/WaitsForAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading