Title: test-net-listen-ipv6only is flaky due to IPv4 port collision · Issue #64172 · nodejs/node · GitHub
Open Graph Title: test-net-listen-ipv6only is flaky due to IPv4 port collision · Issue #64172 · nodejs/node
X Title: test-net-listen-ipv6only is flaky due to IPv4 port collision · Issue #64172 · nodejs/node
Description: Test test/parallel/test-net-listen-ipv6only.js Platform Environment-independent root cause; observed on macOS (arm64) but can occur on any platform under high test parallelism. Console output Observed once during a full python3 tools/tes...
Open Graph Description: Test test/parallel/test-net-listen-ipv6only.js Platform Environment-independent root cause; observed on macOS (arm64) but can occur on any platform under high test parallelism. Console output Obser...
X Description: Test test/parallel/test-net-listen-ipv6only.js Platform Environment-independent root cause; observed on macOS (arm64) but can occur on any platform under high test parallelism. Console output Obser...
Opengraph URL: https://github.com/nodejs/node/issues/64172
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test-net-listen-ipv6only is flaky due to IPv4 port collision","articleBody":"### Test\n\n`test/parallel/test-net-listen-ipv6only.js`\n\n### Platform\n\nEnvironment-independent root cause; observed on macOS (arm64) but can occur on any platform under high test parallelism.\n\n### Console output\n\nObserved once during a full `python3 tools/test.py` run (5521 passing, this test failing). The test passes 10/10 when run in isolation, which is the typical signature of a port-collision flake.\n\n### What is the problem?\n\nThe test verifies that `ipv6Only: true` disables dual-stack support. It listens on `::` with an ephemeral port (`port: 0`) and then connects to the **same port over IPv4** (`0.0.0.0`), expecting `ECONNREFUSED` — i.e. it assumes the IPv4 side of that port is free:\n\n```js\nserver.listen({ host: '::', port: 0, ipv6Only: true }, common.mustCall(() => {\n const { port } = server.address();\n const socket = net.connect({ host: '0.0.0.0', port });\n socket.on('connect', common.mustNotCall()); // \u003c- fires under collision\n socket.on('error', common.mustCall((err) => {\n assert.strictEqual(err.code, 'ECONNREFUSED');\n server.close();\n }));\n}));\n```\n\nThe IPv4 side of the chosen ephemeral port is never reserved. Under heavy parallel\nexecution another test can occupy that same IPv4 port, so the connection succeeds\ninstead of being refused and `common.mustNotCall()` on `'connect'` fires (or the\n`ECONNREFUSED` assertion fails).\n\nThis is the same port-collision flake that previously affected the sibling cluster\nvariants — see #25813 / #29679, fixed in #26298 (\"eliminate port collision\"),\n#32381 and #32398, which moved the `ipv6Only: true` cases to `test/sequential/`\nwith a static port. The plain (non-cluster) test never received that treatment.\n\n### Fix\n\nMove the test to `test/sequential/` and use a fixed `common.PORT`, so it does not run\nconcurrently with other tests competing for the same IPv4 port. PR to follow.\n","author":{"url":"https://github.com/Han5991","@type":"Person","name":"Han5991"},"datePublished":"2026-06-27T13:10:12Z","url":"https://github.com/nodejs/node/issues/64172"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:55b99856-2f2c-d367-02c2-0ac090eae1bb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C84C:1587FA:7D4C5C:A70F90:6AED27D0 |
| html-safe-nonce | 4a6bac60d96a618aed8c30cba04c55eb1a4cc253a0029dc35cc11b8d5a6767e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODRDOjE1ODdGQTo3RDRDNUM6QTcwRjkwOjZBRUQyN0QwIiwidmlzaXRvcl9pZCI6IjI2NzA4NDA4NDY2MjkwMjE2NDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cdfb21e8c8ba7d1fe60296dbc97ca8574b2d45192501b0125439c616c7573f9d |
| hovercard-subject-tag | issue:4758429848 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64172/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b27a916ab2af07d694f7ed9ecbb1711542a63fd2f1deeb76ffbc6a2eff22a871/nodejs/node/issues/64172 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b27a916ab2af07d694f7ed9ecbb1711542a63fd2f1deeb76ffbc6a2eff22a871/nodejs/node/issues/64172 |
| og:image:alt | Test test/parallel/test-net-listen-ipv6only.js Platform Environment-independent root cause; observed on macOS (arm64) but can occur on any platform under high test parallelism. Console output Obser... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Han5991 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width