Skip to content

Commit

Permalink
Fix infinite tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-csala committed Sep 17, 2024
1 parent 4d93337 commit 3b1e7d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ public void Execute_NotHandledOriginalAttempt_EnsureAttemptReported()
public void Execute_NotHandledFinalAttempt_EnsureAttemptReported()
{
_options.MaxRetryAttempts = 1;
_options.Delay = TimeSpan.FromMilliseconds(50);

// original attempt is handled, retried attempt is not handled
_options.ShouldHandle = args => new ValueTask<bool>(args.AttemptNumber == 0);
Expand Down Expand Up @@ -360,6 +361,7 @@ public void Execute_NotHandledFinalAttempt_EnsureAttemptReported()
public void Execute_HandledFinalAttempt_EnsureAttemptReported()
{
_options.MaxRetryAttempts = 1;
_options.Delay = TimeSpan.FromMilliseconds(50);
_options.ShouldHandle = _ => new ValueTask<bool>(true);
var called = false;
_telemetry = TestUtilities.CreateResilienceTelemetry(args =>
Expand Down

0 comments on commit 3b1e7d7

Please sign in to comment.