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(
391
391
}
392
392
393
393
[ Fact ]
394
+ [ QuarantinedTest ( "https://github.com/dotnet/aspnetcore/issues/58086" ) ]
394
395
public async Task Http1Connection_ServerAbort_HasErrorType ( )
395
396
{
396
397
var testMeterFactory = new TestMeterFactory ( ) ;
@@ -399,17 +400,25 @@ public async Task Http1Connection_ServerAbort_HasErrorType()
399
400
var serviceContext = new TestServiceContext ( LoggerFactory , metrics : new KestrelMetrics ( testMeterFactory ) ) ;
400
401
401
402
var sendString = "POST / HTTP/1.0\r \n Content-Length: 12\r \n \r \n Hello World?" ;
403
+ var finishedSendingTcs = new TaskCompletionSource ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
402
404
403
- await using var server = new TestServer ( c =>
405
+ await using var server = new TestServer ( async c =>
404
406
{
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
+
405
413
c . Abort ( ) ;
406
- return Task . CompletedTask ;
407
414
} , serviceContext ) ;
408
415
409
416
using ( var connection = server . CreateConnection ( ) )
410
417
{
411
418
await connection . Send ( sendString ) . DefaultTimeout ( ) ;
412
419
420
+ finishedSendingTcs . SetResult ( ) ;
421
+
413
422
await connection . ReceiveEnd ( ) . DefaultTimeout ( ) ;
414
423
415
424
await connection . WaitForConnectionClose ( ) . DefaultTimeout ( ) ;
You can’t perform that action at this time.
0 commit comments