Skip to content

Commit c3e3846

Browse files
committed
Update PolyfillTests_Task.cs
1 parent 3c644cc commit c3e3846

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Tests/PolyfillTests_Task.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ public async Task WaitAsync_TimeoutAndToken_CancellationBeforeTimeout_ThrowsTask
199199
cancelSource.CancelAfter(100);
200200
var task = Task.Delay(10000);
201201

202-
// Act & Assert (cancellation should win)
203-
await Assert.That(async () =>
204-
await task.WaitAsync(TimeSpan.FromMilliseconds(500), cancelSource.Token)).Throws<TaskCanceledException>();
202+
// Act & Assert (cancellation should win - use 5s timeout to ensure cancellation fires first on slow CI servers)
203+
await Assert.ThrowsAsync<TaskCanceledException>(async () =>
204+
await task.WaitAsync(TimeSpan.FromSeconds(5), cancelSource.Token));
205205
}
206206

207207
[Test]

0 commit comments

Comments
 (0)