Skip to content

Commit bfcb59a

Browse files
committed
test: deflake test-net-listen-ipv6only
The test verified ipv6Only by connecting to the IPv4 side of an ephemeral port and expecting ECONNREFUSED, but it never reserved that IPv4 port. Under parallel execution another test could occupy it, making the connection succeed instead of being refused. Run the test sequentially with a fixed common.PORT so it no longer competes with other tests for the same port, matching the fix already applied to the sibling cluster variants. Fixes: #64172 Signed-off-by: sangwook <rewq5991@gmail.com>
1 parent 2902b2b commit bfcb59a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/parallel/test-net-listen-ipv6only.js renamed to test/sequential/test-net-listen-ipv6only.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ const net = require('net');
1111

1212
const host = '::';
1313
const server = net.createServer();
14+
// Use a fixed port and run this test sequentially. The assertion below relies
15+
// on nothing else listening on the IPv4 side of the chosen port; with an
16+
// ephemeral port under parallel execution another test can occupy that IPv4
17+
// port, making the connection succeed instead of being refused.
1418
server.listen({
1519
host,
16-
port: 0,
20+
port: common.PORT,
1721
ipv6Only: true,
1822
}, common.mustCall(() => {
1923
const { port } = server.address();

0 commit comments

Comments
 (0)