Skip to content

Fix WinHTTP proxy test history for feature-detection sessions - #136470

Merged
rzikm merged 1 commit into
dotnet:mainfrom
rzikm:rzikm/winhttp-proxy-regression
Oct 27, 2026
Merged

rzikm merged 1 commit into
dotnet:mainfrom
rzikm:rzikm/winhttp-proxy-regression

Conversation

@rzikm

@rzikm rzikm commented Oct 26, 2026

Copy link
Copy Markdown
Member

The first request in a process initializes trailer-support detection, which opens an additional WinHTTP session with default-proxy settings. The fake WinHttpOpen records that probe over the request session's settings, so proxy assertions can fail depending on test-class execution order. This reproduces as SendAsync_UseNoProxy_ExpectedWinHttpProxySettings expecting 1 but observing 0 in 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

  • Clean baseline: build.cmd clr+libs -rc release passed with no warnings or errors.
  • CoreCLR unit suite: 173 passed, no failures or skips. The original cold-process no-proxy test failed before the fix and passed afterward.
  • NativeAOT unit suite with /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.
  • Broader functional testing was not entirely green: net11.0-windows had 1,740 passed, 2 failed, and 43 skipped; both failures were 100-second timeouts in automatic client-certificate tests (HTTP/1.1 and HTTP/2). These tests do not use the modified unit-test fakes. net481 had 652 passed, no failures, and 29 skipped. No tests were disabled or changed to suppress these failures.

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.

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

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

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@rzikm
rzikm requested a review from a team October 27, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants