Skip to content

Update SDK to 9.0.100-alpha.1.23421.9 #49911

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

Merged
merged 19 commits into from
Aug 31, 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
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "8.0.100-rc.2.23422.11"
"version": "9.0.100-alpha.1.23421.9"
},
"tools": {
"dotnet": "8.0.100-rc.2.23422.11",
"dotnet": "9.0.100-alpha.1.23421.9",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Http.Timeouts;
using Microsoft.AspNetCore.Testing;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;

namespace Microsoft.AspNetCore.WebSockets.Test;
Expand Down Expand Up @@ -516,21 +517,19 @@ public async Task WebSocket_Abort_Interrupts_Pending_ReceiveAsync()
serverSocket = await context.WebSockets.AcceptWebSocketAsync();
socketWasAccepted.Set();

var serverBuffer = new byte[1024];

try
{
while (serverSocket.State is WebSocketState.Open or WebSocketState.CloseSent)
{
if (firstReceiveOccured.IsSet)
{
var pendingResponse = serverSocket.ReceiveAsync(serverBuffer, default);
var pendingResponse = serverSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), default);
secondReceiveInitiated.Set();
var response = await pendingResponse;
}
else
{
var response = await serverSocket.ReceiveAsync(serverBuffer, default);
var response = await serverSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), default);
firstReceiveOccured.Set();
}
}
Expand All @@ -543,6 +542,7 @@ public async Task WebSocket_Abort_Interrupts_Pending_ReceiveAsync()
catch (Exception ex)
{
// Capture this exception so a test failure can give us more information.
Logger.LogError(ex, "Unexpected error.");
receiveException = ex;
}
finally
Expand Down Expand Up @@ -592,15 +592,13 @@ public async Task WebSocket_AllowsCancelling_Pending_ReceiveAsync_When_Cancellat
serverSocket = await context.WebSockets.AcceptWebSocketAsync();
socketWasAccepted.Set();

var serverBuffer = new byte[1024];

var finishedWithOperationCancelled = false;

try
{
while (serverSocket.State is WebSocketState.Open or WebSocketState.CloseSent)
{
var response = await serverSocket.ReceiveAsync(serverBuffer, cts.Token);
var response = await serverSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), cts.Token);
firstReceiveOccured.Set();
}
}
Expand All @@ -609,6 +607,11 @@ public async Task WebSocket_AllowsCancelling_Pending_ReceiveAsync_When_Cancellat
operationWasCancelled.Set();
finishedWithOperationCancelled = true;
}
catch (Exception ex)
{
Logger.LogError(ex, "Unexpected error.");
throw;
}
finally
{
Assert.True(finishedWithOperationCancelled);
Expand Down