Repository navigation
[Core] Make NettyAsyncHttpClientBuilderTests proxy tests isolated from the agent environment - #50778
Closed
Isabelle (ibrandes) wants to merge 3 commits into
Closed
Isabelle (ibrandes) wants to merge 3 commits into
Isabelle (ibrandes) wants to merge 3 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 34 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
There was a problem hiding this comment.
🟡 Changes recommended
Ambient JVM proxy properties can still leak into the tests and alter proxy selection.
1 open finding
What changed in this PR
Isolates Netty proxy tests from ambient CI proxy environment variables.
Changes:
- Adds a neutral proxy environment source.
- Applies it across environment and explicit proxy test configurations.
| File | Description |
|---|---|
NettyAsyncHttpClientBuilderTests.java |
Shadows ambient proxy environment variables in proxy tests. |
🧠 Review effort: Balanced
Isabelle (ibrandes)
marked this pull request as ready for review
October 14, 2026 16:46
Isabelle (ibrandes)
requested review from
a team,
Jonathan Giles (JonathanGiles),
Alan Zimmer (alzimmermsft) and
vcolin7
as code owners
October 14, 2026 16:46
Member
Author
|
Issue was fixed after upgrading to Netty 4.2 |
Isabelle (ibrandes)
deleted the
core/buildWithEnvConfigurationProxyFlakiness
branch
October 15, 2026 17:55
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.

This PR unblocks my netty 100 continue support PR by fixing the flaky/failing proxy tests causing CI failures. (Note: the CI failures began on October 7th before my netty 100 continue support PR)
Link to pipeline example failure
Summary
NettyAsyncHttpClientBuilderTests.buildWithEnvConfigurationProxy(and, latently,buildWithExplicitConfigurationProxy) read the real proxy environment of the CI agent, so they fail deterministically on hosted agents that sit behind a proxy. This PR makes proxy resolution in these tests self-contained by shadowing the ambientHTTP_PROXY/HTTPS_PROXY/NO_PROXYso the tests depend only on their ownTestConfigurationSourcevalues.Root cause
com.azure.core.implementation.util.EnvironmentConfiguration.getOrLoadfalls back to the realSystem.getenv(name)/System.getProperty(name)for any key a testConfigurationSourceleaves unset. The env-style test cases set onlyHTTP_PROXY, soHTTPS_PROXYandNO_PROXYfell through to the agent's real values.ProxyOptions.fromConfigurationreadsHTTPS_PROXYbeforeHTTP_PROXYand also readsNO_PROXY, which on hosted Windows agents (HTTPS_PROXY=http://10.x.x.x:18080,NO_PROXY=localhost,127.0.0.1,…) produced:NO_PROXY→ no proxy handler (expected: not <null>), andHTTPS_PROXY→ netty's plainHttpProxyHandlerinstead of Azure's (expected <true> but was <false>).The
buildWithExplicitConfigurationProxysupplier used the global-environmentnew ConfigurationBuilder(), so it had the same latent exposure.Changes
Test-only, in
sdk/core/azure-core-http-netty/.../NettyAsyncHttpClientBuilderTests.java:NEUTRAL_PROXY_ENV_SOURCEthat setsHTTP_PROXY/HTTPS_PROXY/NO_PROXYto"", and used it as the environment source for everyConfigurationBuilderin both proxy-test suppliers (replacingEMPTY_SOURCE/ the globalnew ConfigurationBuilder()).simpleEnvProxy,envProxyWithAuthentication), explicitly shadowedHTTPS_PROXY/NO_PROXY.