From ef14f7294063c97af7fabed3c203600bc206b766 Mon Sep 17 00:00:00 2001 From: martincostello Date: Thu, 7 Mar 2024 18:56:30 +0000 Subject: [PATCH] Remove async void usage Remove tests using `async void` that shouldn't be. --- .../Hedging/HedgingResilienceStrategyTests.cs | 4 ++-- test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs | 4 ++-- .../Issues/IssuesTests.PartitionedRateLimiter_1365.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Polly.Core.Tests/Hedging/HedgingResilienceStrategyTests.cs b/test/Polly.Core.Tests/Hedging/HedgingResilienceStrategyTests.cs index 57e7d8bf6b5..bb66c7f4d8b 100644 --- a/test/Polly.Core.Tests/Hedging/HedgingResilienceStrategyTests.cs +++ b/test/Polly.Core.Tests/Hedging/HedgingResilienceStrategyTests.cs @@ -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..."); @@ -658,7 +658,7 @@ ValueTask> BackgroundWork(ResilienceContext resilienceContext) } [Fact] - public async void ExecuteAsync_ZeroHedgingDelay_EnsureAllTasksSpawnedAtOnce() + public async Task ExecuteAsync_ZeroHedgingDelay_EnsureAllTasksSpawnedAtOnce() { // arrange int executions = 0; diff --git a/test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs b/test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs index 6e5a4717398..16aa1188d85 100644 --- a/test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs +++ b/test/Polly.Core.Tests/Retry/RetryResilienceStrategyTests.cs @@ -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(); var delays = new List(); @@ -244,7 +244,7 @@ public async void OnRetry_EnsureCorrectArguments() } [Fact] - public async void MaxDelay_EnsureRespected() + public async Task MaxDelay_EnsureRespected() { var delays = new List(); _options.OnRetry = args => diff --git a/test/Polly.Extensions.Tests/Issues/IssuesTests.PartitionedRateLimiter_1365.cs b/test/Polly.Extensions.Tests/Issues/IssuesTests.PartitionedRateLimiter_1365.cs index ffc0555bbb3..9f77b2f3e09 100644 --- a/test/Polly.Extensions.Tests/Issues/IssuesTests.PartitionedRateLimiter_1365.cs +++ b/test/Polly.Extensions.Tests/Issues/IssuesTests.PartitionedRateLimiter_1365.cs @@ -12,7 +12,7 @@ public partial class IssuesTests /// Additionally, it also shows how to disable rate limiting for admin users. /// [Fact] - public async void PartitionedRateLimiter_EnsureUserLimited_1365() + public async Task PartitionedRateLimiter_EnsureUserLimited_1365() { // arrange var userKey = new ResiliencePropertyKey("user");