Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Apr 13, 2023
1 parent 5340b8f commit 295c903
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task Execute_EnsureOnTimeoutCalled()
args.Exception.Should().BeAssignableTo<OperationCanceledException>();
args.Timeout.Should().Be(_delay);
args.Context.Should().NotBeNull();
args.Context.CancellationToken.IsCancellationRequested.Should().BeTrue();
args.Context.CancellationToken.IsCancellationRequested.Should().BeFalse();
called = true;
});

Expand Down
1 change: 1 addition & 0 deletions src/Polly.Core/Utils/TimeProviderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static Task DelayAsync(this TimeProvider timeProvider, TimeSpan delay, Re

if (context.IsSynchronous && timeProvider == TimeProvider.System)
{
// Stryker disable once boolean : no means to test this
if (context.CancellationToken.CanBeCanceled)
{
context.CancellationToken.WaitHandle.WaitOne(delay);
Expand Down

0 comments on commit 295c903

Please sign in to comment.