Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few async void tests to be async Task #82914

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task Constructor_NoEntryInsertion_WritesNothing_Async()
}

[Fact]
public async void Write_To_UnseekableStream_Async()
public async Task Write_To_UnseekableStream_Async()
{
await using (MemoryStream inner = new MemoryStream())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ await kerberosExecutor.Invoke(() =>
}

[Fact]
public async void Invalid_Token()
public async Task Invalid_Token()
{
using var kerberosExecutor = new KerberosExecutor(_testOutputHelper, "LINUX.CONTOSO.COM");
// Force a non-empty keytab to make macOS happy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class CountersTest
{
[Fact]
[SkipOnPlatform(TestPlatforms.Browser, "Wasm is single-threaded, which makes TestEventListener ineffective.")]
public async void Basic_Counters()
public async Task Basic_Counters()
{
string cacheName = "Basic_Counters_Test";
var cip = new CacheItemPolicy() { /* _absExpiry = ObjectCache.InfiniteAbsoluteExpiration */ };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Period_Roundtrips()
}

[Fact]
public async void Period_AffectsPendingWaits()
public async Task Period_AffectsPendingWaits()
{
using PeriodicTimer timer = new PeriodicTimer(TimeSpan.FromDays(40));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ public static IEnumerable<object[]> Match_DeepNesting_MemberData()

[Theory]
[MemberData(nameof(Match_DeepNesting_MemberData))]
public async void Match_DeepNesting(RegexEngine engine, int count)
public async Task Match_DeepNesting(RegexEngine engine, int count)
{
const string Start = @"((?>abc|(?:def[ghi]", End = @")))";
const string Match = "defg";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ public void ReplenishHonorsTokensPerPeriod()
}

[Fact]
public async void TryReplenishWithAllTokensAvailable_Noops()
public async Task TryReplenishWithAllTokensAvailable_Noops()
{
var limiter = new TokenBucketRateLimiter(new TokenBucketRateLimiterOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ public static void CancellationTokenSource_CancelAsync_NoRegistrations_CallbackC
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public static async void CancellationTokenSource_CancelAsync_CallbacksInvokedAsynchronously()
public static async Task CancellationTokenSource_CancelAsync_CallbacksInvokedAsynchronously()
{
var cts = new CancellationTokenSource();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void BeginFromTask_CompletedSynchronously_CallbackInvokedSynchronously()
}

[Fact]
public async void BeginFromTask_CompletedAsynchronously_CallbackInvokedAsynchronously()
public async Task BeginFromTask_CompletedAsynchronously_CallbackInvokedAsynchronously()
{
var tcs = new TaskCompletionSource();
var invoked = new TaskCompletionSource();
Expand Down