runtime: System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandlerTest.PostAsync_RedirectWith302_LargePayload failed with "System.OperationCanceledException" in CI

Failed test: System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandlerTest.PostAsync_RedirectWith302_LargePayload Configuration: OuterLoop_netcoreapp_ubuntu14.04_debug

Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_ubuntu14.04_debug/131/testReport/System.Net.Http.Functional.Tests/ManagedHandler_HttpClientHandlerTest/PostAsync_RedirectWith302_LargePayload/

MESSAGE:

System.OperationCanceledException : The operation was canceled.

STACK TRACE:

at System.Net.Http.HttpClient.HandleFinishSendAsyncError(Exception e, CancellationTokenSource cts) in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 508 
at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 463 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_Redirect_LargePayload_Helper>d__83.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs:line 1582 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_RedirectWith302_LargePayload>d__82.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs:line 1566
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

We have recently update our service to use Visual Studio 2017 and ASP.NET Core 2.0 , so not sure if your comment fully hold true.

That ConnectStream class simply doesn’t exist in corefx. If it’s showing up on the stack, you’re not running on .NET Core. In .NET Core, HttpWebRequest is actually layered on top of HttpClient, so these internal types from the .NET Framework aren’t there.

What fix do you recommend in such case?

To start, I’d recommend switching to using HttpClient directly rather than using HttpWebRequest. You generally want to create a single instance of HttpClient that’s then shared for all of your requests.

As for root causing the issue, I would suggest taking a network trace. My guess is that the server is actually closing the connection after two minutes, but that’s just a guess; I’m not very familiar with that implementation.