Repository contains a repro for possible issue related to the Microsoft.AspNetCore.Mvc.Testing
- Start the web app. Go to the
src/Microsoft.AspNetCore.Mvc.Testing
and call dotnet run
. Let in run in the background.
- In second terminal or IDE start the tests located in the
src/Tests
ShouldRetry_OnRemoteInstance
should pass
ShouldRetry_OnInMemoryInstance
should fail with error
System.Net.Http.HttpRequestException : Error while copying content to a stream.
---- System.IO.IOException :
-------- System.IO.IOException : The client aborted the request.
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Tests.CheckRetry.ShouldRetry_OnInMemoryInstance() in C:\dev\testserverIssue\src\Tests\CheckRetry.cs:line 23
--- End of stack trace from previous location where exception was thrown ---
----- Inner Stack Trace -----
at Microsoft.AspNetCore.TestHost.ResponseBodyReaderStream.CheckAborted()
at Microsoft.AspNetCore.TestHost.ResponseBodyReaderStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at System.IO.Stream.CopyToAsyncInternal(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
----- Inner Stack Trace -----