Skip to content
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

Merged
merged 25 commits into from
Jan 21, 2020

Conversation

ManickaP
Copy link
Member

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 of UseSocketHandler.
Some of the code must be conditionally compiled since there is no usable common base class for HttpClientHandler and WinHttpHandler. Other issues solved by introducing WinHttpClientHandler for testing purposes. It corresponds to HttpClientHandler.Windows.cs code from before its removal.

Resolves #339

@ManickaP
Copy link
Member Author

/azp list

@ManickaP
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP
Copy link
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP
Copy link
Member Author

No failed tests, cancelled due to timeouts.

@ManickaP ManickaP marked this pull request as ready for review January 15, 2020 15:44
@ManickaP ManickaP requested a review from a team January 15, 2020 15:44
# 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
Copy link
Contributor

@scalablecory scalablecory left a 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.

// 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).
Copy link
Contributor

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?

Copy link
Member Author

@ManickaP ManickaP Jan 20, 2020

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.

@ManickaP
Copy link
Member Author

ManickaP commented Jan 20, 2020

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.

Yep, the lesser evil 😄

@ManickaP ManickaP merged commit 26298bc into dotnet:master Jan 21, 2020
@ManickaP ManickaP deleted the mapichov/339_WinHttpHandlerTests branch January 21, 2020 18:55
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move WinHttpHandler tests to System.Net.Http.WinHttpHandler
5 participants