Skip to content

WinHttpHandler tests are back - #1676

Merged
ManickaP merged 25 commits into
dotnet:masterfrom
ManickaP:mapichov/339_WinHttpHandlerTests
Jan 21, 2020
Merged

ManickaP merged 25 commits into
dotnet:masterfrom
ManickaP:mapichov/339_WinHttpHandlerTests

Conversation

@ManickaP

Copy link
Copy Markdown
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
Copy Markdown
Member Author

/azp list

@ManickaP

Copy link
Copy Markdown
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP

Copy link
Copy Markdown
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP

Copy link
Copy Markdown
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP

Copy link
Copy Markdown
Member Author

/azp run runtime-libraries outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ManickaP

Copy link
Copy Markdown
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

@scalablecory scalablecory left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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?

@ManickaP ManickaP Jan 20, 2020 •

Copy link
Copy Markdown
Member Author

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

ManickaP commented Jan 20, 2020 •

Copy link
Copy Markdown
Member Author

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