Skip to content

Commit

Permalink
Remove async void usage
Browse files Browse the repository at this point in the history
Remove tests using `async void` that shouldn't be.
  • Loading branch information
martincostello committed Mar 7, 2024
1 parent 77cfe6d commit ef14f72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public async Task ExecuteAsync_EnsurePrimaryContextFlows()
}

[Fact]
public async void ExecuteAsync_EnsureHedgedTasksCancelled_Ok()
public async Task ExecuteAsync_EnsureHedgedTasksCancelled_Ok()
{
// arrange
_testOutput.WriteLine("ExecuteAsync_EnsureHedgedTasksCancelled_Ok executing...");
Expand Down Expand Up @@ -658,7 +658,7 @@ ValueTask<Outcome<string>> BackgroundWork(ResilienceContext resilienceContext)
}

[Fact]
public async void ExecuteAsync_ZeroHedgingDelay_EnsureAllTasksSpawnedAtOnce()
public async Task ExecuteAsync_ZeroHedgingDelay_EnsureAllTasksSpawnedAtOnce()
{
// arrange
int executions = 0;
Expand Down
4 changes: 2 additions & 2 deletions test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public override ITimer CreateTimer(TimerCallback callback, object? state, TimeSp
}

[Fact]
public async void OnRetry_EnsureCorrectArguments()
public async Task OnRetry_EnsureCorrectArguments()
{
var attempts = new List<int>();
var delays = new List<TimeSpan>();
Expand Down Expand Up @@ -244,7 +244,7 @@ public async void OnRetry_EnsureCorrectArguments()
}

[Fact]
public async void MaxDelay_EnsureRespected()
public async Task MaxDelay_EnsureRespected()
{
var delays = new List<TimeSpan>();
_options.OnRetry = args =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial class IssuesTests
/// Additionally, it also shows how to disable rate limiting for admin users.
/// </summary>
[Fact]
public async void PartitionedRateLimiter_EnsureUserLimited_1365()
public async Task PartitionedRateLimiter_EnsureUserLimited_1365()
{
// arrange
var userKey = new ResiliencePropertyKey<string>("user");
Expand Down

0 comments on commit ef14f72

Please sign in to comment.