Repository navigation
[Core] Fix HTTP client tests that break under the CI agents' network-isolation proxy - #51110
Merged
Alan Zimmer (alzimmermsft) merged 3 commits intoNov 6, 2026
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 33 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.
🟢 Approval recommended
No active review issues were identified for this test-only proxy assertion update.
No open issues 🎉
What changed in this PR
This test-only change fixes Vert.x HTTP client provider assertions when the JVM proxy host is an IP address. It aligns proxy loading in the tests with the existing builder behavior; production code is unchanged.
Changes:
- Use a shared helper to load unresolved environment proxies in both default-client tests.
- Explain why resolving proxy addresses can cause reverse-DNS hostname mismatches.
| File | Description |
|---|---|
| sdk/core/azure-core-http-vertx/src/test/java/com/azure/core/http/vertx/VertxHttpClientProviderTests.java | Load unresolved proxies in both tests to preserve the configured host during assertions. |
Review effort: Balanced
Isabelle (ibrandes)
marked this pull request as ready for review
November 5, 2026 20:00
Isabelle (ibrandes)
requested review from
a team,
Jonathan Giles (JonathanGiles),
Alan Zimmer (alzimmermsft) and
vcolin7
as code owners
November 5, 2026 20:00
Alan Zimmer (alzimmermsft)
approved these changes
Nov 6, 2026
Isabelle (ibrandes)
deleted the
core/vertxProviderTestsUnresolvedProxy
branch
November 6, 2026 18:31
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.
Description
Since the Linux CI agents' 1ES Network Isolation task updated from 1.0.192 to 1.0.193 (Nov 4), core HTTP client tests that read the global proxy configuration fail on any PR that runs them. Two separate test bugs are exposed. Production code is not affected.
The agents' network-isolation setup:
HTTPS_PROXY,http_proxy, andNO_PROXY=localhost,127.0.0.1,...for the pipeline (already the case before the update), andJAVA_TOOL_OPTIONS, which includes-Dhttps.proxyHost=<agent IP> -Dhttps.proxyPort=18080 -Dhttp.nonProxyHosts=localhost|127.0.0.1|..., so every JVM, including the test JVMs, now sees a JVM proxy.1.
VertxHttpClientProviderTests: resolved versus unresolved proxy hostnullOptionsReturnsBaseClientanddefaultOptionsReturnsBaseClientfail with:ProxyOptions.fromConfigurationignores theHTTPS_PROXYenvironment variable unlessjava.net.useSystemProxies=true, but it does read the JVM'shttps.proxyHost. Before 1.0.193 these tests saw no proxy and passed.VertxHttpClientBuilderloads the proxy unresolved (ProxyOptions.fromConfiguration(configuration, true)), so Vert.x is configured with the host exactly as given:10.1.0.164.ProxyOptions.fromConfiguration(configuration)) and comparedgetAddress().getHostName(). For a resolved IP address that does a reverse DNS lookup, which on the Azure agents returns the VM's internal name.2.
buildWithHttpProxyFromEnvConfiguration(Vert.x and JDK): the agent'sNO_PROXYleaks inVertxHttpClientBuilderTests.buildWithHttpProxyFromEnvConfigurationandJdkHttpClientBuilderTests.buildWithHttpProxyFromEnvConfigurationfail with:NO_PROXY. For any variable the fake doesn't define,EnvironmentConfigurationreads the real one, so the agent'sNO_PROXYleaked in.localhost, the client skipped the test proxy and connected directly tolocalhost:80.Changes
VertxHttpClientProviderTests: both tests now load the environment proxy the wayVertxHttpClientBuilderdoes, unresolved (ProxyOptions.fromConfiguration(Configuration.getGlobalConfiguration(), true)), through a small helper with a comment explaining why.getHostName()then returns the configured host without a DNS lookup.VertxHttpClientBuilderTestsandJdkHttpClientBuilderTests:buildWithHttpProxyFromEnvConfigurationsetsPROPERTY_NO_PROXYto""in its fake configuration, as the Netty and OkHttp builder tests already do.NettyAsyncHttpClientProviderTestsandOkHttpAsyncClientProviderTestsuse the same proxy-loading pattern as the Vert.x provider tests but compare wholeInetSocketAddressobjects. They pass with the same JVM proxy setting, so they are unchanged.No CHANGELOG entries, as only tests change.
Validation
To mimic the agents, these environment variables were set locally, with
8.8.8.8(an IP whose reverse DNS name isdns.google) in place of the agent IP:JAVA_TOOL_OPTIONS=-Dhttps.proxyHost=8.8.8.8 -Dhttps.proxyPort=18080 -Dhttp.nonProxyHosts=localhost|127.0.0.1|169.254.169.254HTTPS_PROXY=http://8.8.8.8:18080,http_proxy=http://8.8.8.8:18080,NO_PROXY=localhost,127.0.0.1,169.254.169.254mvn -o -f sdk/core/azure-core-http-vertx/pom.xml test -Dtest=VertxHttpClientProviderTestswith only theJAVA_TOOL_OPTIONSproxyexpected: <dns.google> but was: <8.8.8.8>), matching CImvn -o -f sdk/core/azure-core-http-vertx/pom.xml test "-Dtest=VertxHttpClientBuilderTests,VertxHttpClientProviderTests"with all of the abovebuildWithHttpProxyFromEnvConfiguration,Connection refused: localhost/127.0.0.1:80), matching CImvn -o -f sdk/core/azure-core-http-jdk-httpclient/pom.xml test -Dtest=JdkHttpClientBuilderTestswith all of the abovebuildWithHttpProxyFromEnvConfiguration)VertxHttpClientProviderTestsalso passed (23 tests) with a hostname JVM proxy (-Dhttps.proxyHost=proxy.example.com) and with no proxy set.checkstyle:checkpassed forazure-core-http-vertxandazure-core-http-jdk-httpclient.NettyAsyncHttpClientProviderTests(24 tests, 1 skipped) andOkHttpAsyncClientProviderTests(21 tests) passed with the sameJAVA_TOOL_OPTIONSproxy, without changes.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines