Skip to content

test: limit concurrency in gc-http-client tests - #67607

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:deflake-gc-http-client
Nov 21, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:deflake-gc-http-client

Conversation

@mcollina

@mcollina mcollina commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

The tests started one request chain per CPU, each issuing a new request on every event loop turn until the first response arrived. On a loaded macOS host this put more than 128 connections in flight, overflowing the listen queue. The kernel then drops an incomplete connection and answers its final ACK with a RST, so the client fails with connect ECONNRESET.

Use a fixed number of concurrent requests and a fixed total instead.

Failure seen on node-test-commit-osx (macos15-x64):

done/collected/total: 1/0/174
done/collected/total: 2/1/174
AggregateError [ECONNRESET]:
    at connectMultipleError (node:net:1521:70)
    ...
  [errors]: [
    Error: connect ECONNRESET ::1:58524 ...
    Error: connect ECONNRESET 127.0.0.1:58524 ...
  ]

174 requests were in flight before the first response. macOS caps the accept queue at kern.ipc.somaxconn (128), regardless of the 511 backlog Node.js requests. When the queue is full, XNU's tcp_dropdropablreq() silently closes a connection that is still in SYN_RECEIVED, and the listener answers the client's final ACK with a RST. Both the ::1 and 127.0.0.1 attempts fail because they share the same dual-stack listener.

I could not reproduce the failure locally on Apple Silicon, where the extra SYNs are dropped and retried instead. With this change, at most 9 connections are open at once, down from 64 locally and 174 on CI.

Drive-by: the error handler in test-gc-http-client-onerror rethrows, fix the comment that says it does nothing.

Refs: #41399


AI generated, reviewed by me.

The tests started one request chain per CPU, each issuing a new request
on every event loop turn until the first response arrived. On a loaded
macOS host this put more than 128 connections in flight, overflowing
the listen queue. The kernel then drops an incomplete connection and
answers its final ACK with a RST, so the client fails with
`connect ECONNRESET`.

Use a fixed number of concurrent requests and a fixed total instead.

Drive-by: the error handler in test-gc-http-client-onerror rethrows,
fix the comment that says it does nothing.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Nov 19, 2026
@mcollina
mcollina requested a review from panva November 19, 2026 11:04
@panva panva added the flaky-test Issues and PRs involving tests that fail intermittently in CI. label Nov 19, 2026
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (d9e18d5) to head (d1b9f78).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67607      +/-   ##
==========================================
- Coverage   90.72%   90.71%   -0.02%     
==========================================
  Files         801      801              
  Lines      280809   280809              
  Branches    54212    54213       +1     
==========================================
- Hits       254776   254733      -43     
- Misses      16209    16247      +38     
- Partials     9824     9829       +5     

see 38 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.

@panva panva added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 19, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 19, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@christianaurichzm christianaurichzm added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 19, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 06250cb into nodejs:main Nov 21, 2026
84 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 06250cb

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. flaky-test Issues and PRs involving tests that fail intermittently in CI. needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants