File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/Servers/Kestrel/test/InMemory.FunctionalTests Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -391,6 +391,7 @@ await connection.ReceiveEnd(
391391 }
392392
393393 [ Fact ]
394+ [ QuarantinedTest ( "https://github.com/dotnet/aspnetcore/issues/58086" ) ]
394395 public async Task Http1Connection_ServerAbort_HasErrorType ( )
395396 {
396397 var testMeterFactory = new TestMeterFactory ( ) ;
@@ -399,17 +400,25 @@ public async Task Http1Connection_ServerAbort_HasErrorType()
399400 var serviceContext = new TestServiceContext ( LoggerFactory , metrics : new KestrelMetrics ( testMeterFactory ) ) ;
400401
401402 var sendString = "POST / HTTP/1.0\r \n Content-Length: 12\r \n \r \n Hello World?" ;
403+ var finishedSendingTcs = new TaskCompletionSource ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
402404
403- await using var server = new TestServer ( c =>
405+ await using var server = new TestServer ( async c =>
404406 {
407+ await c . Request . Body . ReadUntilEndAsync ( ) ;
408+
409+ // An extra check to ensure that client is done sending before the server aborts.
410+ // This might not be necessary since we're reading to the end of the request body, but it doesn't hurt.
411+ await finishedSendingTcs . Task ;
412+
405413 c . Abort ( ) ;
406- return Task . CompletedTask ;
407414 } , serviceContext ) ;
408415
409416 using ( var connection = server . CreateConnection ( ) )
410417 {
411418 await connection . Send ( sendString ) . DefaultTimeout ( ) ;
412419
420+ finishedSendingTcs . SetResult ( ) ;
421+
413422 await connection . ReceiveEnd ( ) . DefaultTimeout ( ) ;
414423
415424 await connection . WaitForConnectionClose ( ) . DefaultTimeout ( ) ;
You can’t perform that action at this time.
0 commit comments