Repository navigation
Fix WinHTTP proxy test history for feature-detection sessions - #136470
Merged
Merged
Conversation
Record proxy settings from the session used by WinHttpConnect so first-use feature detection cannot overwrite request-session assertions. Preserve Open-only history and leave production proxy behavior unchanged. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
wfurt
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first request in a process initializes trailer-support detection, which opens an additional WinHTTP session with default-proxy settings. The fake
WinHttpOpenrecords that probe over the request session's settings, so proxy assertions can fail depending on test-class execution order. This reproduces asSendAsync_UseNoProxy_ExpectedWinHttpProxySettingsexpecting1but observing0in NativeAOT runs.Keep proxy settings on each fake session handle and record the settings of the session actually used by
WinHttpConnect. This preserves Open-only observations, leaves feature detection and production behavior unchanged, and does not relax any assertions.Validation
build.cmd clr+libs -rc releasepassed with no warnings or errors./p:TestNativeAot=true /p:IlcOptimizationPreference=Size: a controlled local-source comparison reproduced 1 failure out of 173 before the fix and 173 passed afterward. All five session-proxy tests also passed individually in fresh processes on both CoreCLR and NativeAOT.Unit runs used
dotnet.cmd build src\libraries\System.Net.Http.WinHttpHandler\tests\UnitTests\System.Net.Http.WinHttpHandler.Unit.Tests.csproj /t:Test /p:RuntimeConfiguration=Release, with the NativeAOT properties above for the NativeAOT runs. The exact CI Checked-runtime configuration was not rebuilt locally.Note
This pull request description and code change were generated with GitHub Copilot.