Skip to content

Commit 7900958

Browse files
committed
Fix SocketsHttpHandlerTest_HttpClientHandlerTest_Http3.ReadAsStreamAsync_Cancellation data race
1 parent 9068070 commit 7900958

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Linq;
77
using System.Net.Http.Headers;
88
using System.Net.Sockets;
9+
using System.Net.Quic;
910
using System.Net.Test.Common;
1011
using System.Security.Authentication;
1112
using System.Security.Cryptography;
@@ -1396,6 +1397,10 @@ await server.AcceptConnectionAsync(async connection =>
13961397
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Transfer-Encoding", "chunked") }, isFinal: false);
13971398
await connection.SendResponseBodyAsync("1\r\nh\r\n", false);
13981399
}
1400+
catch (QuicException ex) when (ex.ApplicationErrorCode == 0x10c /*H3_REQUEST_CANCELLED*/)
1401+
{
1402+
// The request was cancelled before we sent the body, ignore
1403+
}
13991404
catch (IOException ex)
14001405
{
14011406
// when testing in the browser, we are using the WebSocket for the loopback

0 commit comments

Comments
 (0)