Skip to content

Commit 3800f9f

Browse files
authored
Update test method to fix test issue:47861 (#49604)
2 parents 301f9e9 + 09ae593 commit 3800f9f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/dotnet.Tests/GivenExponentialRetry.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ public async Task ItReturnsOnSuccess()
2525
retryCount.Should().Be(1);
2626
}
2727

28-
[Fact(Skip = "https://github.com/dotnet/sdk/issues/47861")]
28+
[Fact]
2929
public async Task ItRetriesOnError()
3030
{
3131
var retryCount = 0;
32-
Func<Task<string>> action = () =>
32+
Func<Task<string?>> action = () => // Updated to use nullable reference type
3333
{
3434
retryCount++;
35-
throw new Exception();
35+
return Task.FromResult<string?>(null); // Updated to match nullable reference type
3636
};
37-
await Assert.ThrowsAsync<AggregateException>(async () => await ExponentialRetry.ExecuteWithRetryOnFailure<string>(action, 2, timer: () => ExponentialRetry.Timer(ExponentialRetry.TestingIntervals)));
37+
var res = await ExponentialRetry.ExecuteWithRetryOnFailure<string?>(action, 2, timer: () => ExponentialRetry.Timer(ExponentialRetry.TestingIntervals));
3838

39+
res.Should().BeNull();
3940
retryCount.Should().Be(2);
4041
}
4142
}

0 commit comments

Comments
 (0)