-
Notifications
You must be signed in to change notification settings - Fork 10.7k
fix flaky Microsoft.AspNetCore.SignalR.Client.Tests.TestServerTests.WebSocketsWorks #65928
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()) | ||
|
|
@@ -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(); | ||
| } | ||
| } | ||
|
|
||
| [Fact] | ||
| [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/65702")] | ||
| public async Task LongPollingWorks() | ||
| { | ||
| using (StartVerifiableLog()) | ||
|
|
@@ -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
|
||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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 duringStartVerifiableLog()disposal). Consider moving the explicit stop calls into afinallyso they run regardless of test failure.