Skip to content
Open
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 @@ -17,7 +17,6 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests;
public class TestServerTests : VerifiableLoggedTest
{
[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/#aw_wswrks1")]
public async Task WebSocketsWorks()
{
using (StartVerifiableLog())
Expand Down Expand Up @@ -76,11 +75,13 @@ public async Task WebSocketsWorks()
await connection.StartAsync();
await connection.InvokeAsync("Echo", originalMessage);
Assert.True(webSocketFactoryCalled);

await connection.StopAsync();
await host.StopAsync();
Comment on lines +79 to +80

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connection.StopAsync() / host.StopAsync() are only executed on the success path. If an earlier await/Assert throws, cleanup falls back to disposal again and can reintroduce the same race (and can also cause additional error logs during StartVerifiableLog() disposal). Consider moving the explicit stop calls into a finally so they run regardless of test failure.

Copilot uses AI. Check for mistakes.
}
}

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/65702")]
public async Task LongPollingWorks()
{
using (StartVerifiableLog())
Expand Down Expand Up @@ -131,6 +132,9 @@ public async Task LongPollingWorks()

await connection.StartAsync();
await connection.InvokeAsync("Echo", originalMessage);

await connection.StopAsync();
await host.StopAsync();
Comment on lines +136 to +137

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: these explicit stop calls only run on the success path. To avoid disposal-time races/log noise when the test fails early, wrap the body in a try/finally and perform connection.StopAsync() / host.StopAsync() in the finally (guarding for partially-initialized state as needed).

Copilot uses AI. Check for mistakes.
}
}
}
Expand Down
Loading