Skip to content

Commit 17a1e38

Browse files
authored
Fix WebSocket cancel test for non-browser (#60173)
Non-browser WS server used for ConnectAsync_Cancel_ThrowsCancellationException doesn't support "delay20sec", only "delay10sec". This basically reverts the change in this line from #58199 for non-browser platforms. Contributes to #58355
1 parent 22b516c commit 17a1e38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.Net.WebSockets.Client/tests/CancelTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task ConnectAsync_Cancel_ThrowsCancellationException(Uri server)
2222
var cts = new CancellationTokenSource(100);
2323

2424
var ub = new UriBuilder(server);
25-
ub.Query = "delay20sec";
25+
ub.Query = PlatformDetection.IsBrowser ? "delay20sec" : "delay10sec";
2626

2727
var ex = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => cws.ConnectAsync(ub.Uri, cts.Token));
2828
Assert.True(WebSocketState.Closed == cws.State, $"Actual {cws.State} when {ex}");

0 commit comments

Comments
 (0)