Skip to content

test: deflake test-net-autoselectfamily-local-port - #66705

Open
nhinata wants to merge 1 commit into
nodejs:mainfrom
nhinata:test-deflake-autoselectfamily-local-port
Open

nhinata wants to merge 1 commit into
nodejs:mainfrom
nhinata:test-deflake-autoselectfamily-local-port

Conversation

@nhinata

@nhinata nhinata commented Oct 13, 2026 •

Copy link
Copy Markdown

test-net-autoselectfamily-local-port failed in CI (reliability report 2026-10-10):
https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu2404_sharedlibs_icu_x64/59770/console

Both the IPv6 and IPv4 attempts fail at bind with EADDRINUSE. The test gets a free port by listening on port 0 and closing it, so another test can take that port before the connection binds to it.

I moved it from test/parallel/ to test/sequential/ and used common.PORT, like test-https-connect-localport (0f7e24a).

On macOS with net/http tests running in the background,
it failed once in 1000 runs before this change and 0 times after.

cc @mcollina

I used an AI coding agent to help investigate the reliability reports and write the repro scripts.
I ran and checked the results above myself.

The test reserved a local port by listening on port 0 and closing
the server, then reused that port as `localPort`. Another test
running in parallel can take the port in between, which makes both
the IPv6 and the IPv4 bind fail with EADDRINUSE.

Move the test to sequential and use `common.PORT`, the same approach
used for test-https-connect-localport in 0f7e24a.

Refs: https://github.com/nodejs/reliability/blob/main/reports/2026-10-10.md
Assisted-by: a closed-source coding agent
Signed-off-by: nhinata <bounceback0505@gmail.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 Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

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 Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants