Skip to content

Conversation

@batrla
Copy link
Contributor

@batrla batrla commented Jan 22, 2026

make test fails behind a proxy

Running tests behind proxy fails when http_proxy and https_proxy variables are defined in the user environment.
Please see below relevant snippets of the output of make -j2 test.

This is on Linux.

  • without the fix:
$ export http_proxy=http://somehost:someport
$ export https_proxy=http://somehost:someport
$ gmake -j2 2>&1 | tee test.nofix.log
...
[07:02|% 100|+ 4985|-  35]: Done

Failed tests:
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-fetch.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-https-proxy.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-invalid-url.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-ipv6.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-no-proxy-port-specific.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-proxy-failure-500.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-proxy-failure-hang-up.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-proxy-request-connection-refused.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-request-proxy-post.mjs
out/Release/node /home/auser/node/test/client-proxy/test-http-request-proxy-post-server-failure.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-auth-failure.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-empty-response.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-fetch.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-handshake-failure.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-https-proxy.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-incomplete-headers.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-invalid-url.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-ipv6.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-malformed-response.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-proxy-failure-404.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-proxy-failure-500.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-proxy-failure-502.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-proxy-failure-hang-up.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-server-failure-hang-up.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-request-proxy-post.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-tunnel-timeout.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-tunnel-timeout-agent.mjs
out/Release/node /home/auser/node/test/client-proxy/test-use-env-proxy-cli-http.mjs
out/Release/node /home/auser/node/test/client-proxy/test-use-env-proxy-cli-https.mjs
out/Release/node /home/auser/node/test/client-proxy/test-use-env-proxy-precedence.mjs
out/Release/node /home/auser/node/test/client-proxy/test-https-proxy-request-connection-refused.mjs
out/Release/node --expose-internals /home/auser/node/test/parallel/test-http2-allow-http1-upgrade-ws.js
out/Release/node --inspect=0 --experimental-network-inspection --expose-internals /home/auser/node/test/parallel/test-inspector-network-fetch.js
make[1]: *** [Makefile:322: jstest] Error 1
make: *** [Makefile:349: test] Error 2
  • with the suggested fix:
$ export http_proxy=http://somehost:someport
$ export https_proxy=http://somehost:someport
$ gmake -j2 2>&1 | tee test.fix.log
...
[06:55|% 100|+ 5022|-   0]: Done                                              

All tests passed.

batrla and others added 9 commits January 21, 2026 21:46
Some client-proxy tests set HTTP_PROXY variable in the environment.
It's OK in general, however, in some specific cases, the user might
have already defined his own http_proxy setting in the environment.
The lowercase user setting takes precedence and leads to a test
failure. The fix cleans up the environment to avoid
an interaction between user and test proxy settings.
toUpper() -> toUpperCase()
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jan 22, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.85%. Comparing base (77e8d44) to head (b701705).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61473      +/-   ##
==========================================
- Coverage   89.87%   89.85%   -0.02%     
==========================================
  Files         671      671              
  Lines      203178   203182       +4     
  Branches    39062    39066       +4     
==========================================
- Hits       182599   182563      -36     
- Misses      12926    12964      +38     
- Partials     7653     7655       +2     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants