-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinHttpHandler tests are back #1676
WinHttpHandler tests are back #1676
Conversation
# Conflicts: # src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
/azp list |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
No failed tests, cancelled due to timeouts. |
# Conflicts: # src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs # src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs # src/libraries/Common/tests/System/Net/Http/SchSendAuxRecordHttpTest.cs # src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/PlatformHandlerTest.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using HttpClientHandler = System.Net.Http.WinHttpClientHandler;
is a bit fun but I can't think of a better way to do this without more invasive changes.
This looks good to me.
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs
Outdated
Show resolved
Hide resolved
// Propagate exception for debugging | ||
task.GetAwaiter().GetResult(); | ||
// With WinHttpHandler, we may fault because canceling the task destroys the request handle | ||
// which may randomly cause an ObjectDisposedException (or other exception). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing an ObjectDisposedException
upon cancellation seems like a bug. @davidsh do you know anything about this behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is just taken from before WinHttpHandler removal in this commit. As is every other condition returned to the tests.
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs
Show resolved
Hide resolved
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AutoRedirect.cs
Show resolved
Hide resolved
Yep, the lesser evil 😄 |
The tests used by
PlatformHandlerTest
moved to Common/tests in order to share them between System.Net.Http and System.Net.Http.WinHttpHandler.The added conditions correspond to the state before WinHttpHandler removal. They're just based on
IsWinHttpHandler
instead ofUseSocketHandler
.Some of the code must be conditionally compiled since there is no usable common base class for
HttpClientHandler
andWinHttpHandler
. Other issues solved by introducingWinHttpClientHandler
for testing purposes. It corresponds to HttpClientHandler.Windows.cs code from before its removal.Resolves #339