test: remove unneeded listeners

Unhandled `'error'` events will make the process exit with an unclean
exit code anyway.

PR-URL: https://github.com/nodejs/node/pull/55486
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This commit is contained in:
Luigi Pinca authored and GitHub committed 2024-10-29 21:52:09 +00:00
1 parent 8aac7da7d6
commit 84fe809535
6 files changed
+4 -11

No files matched your search

@@ -32,4 +32,4 @@ const socket = dgram.createSocket(options);
socket.bind(+process.env.port, common.mustCall(() => {
socket.close();
})).on('error', common.mustNotCall());
}));
@@ -32,4 +32,4 @@ const server = net.createServer();
server.listen({ ...options, port: +process.env.port }, common.mustCall(() => {
server.close();
})).on('error', common.mustNotCall());
}));
@@ -35,5 +35,5 @@ socket1.bind(0, () => {
socket2.bind(socket1.address().port, () => {
socket1.close(close);
socket2.close(close);
}).on('error', common.mustNotCall());
}).on('error', common.mustNotCall());
});
});
@@ -36,6 +36,3 @@ server1.listen(options, common.mustCall(() => {
server2.close(close);
}));
}));
server1.on('error', common.mustNotCall());
server2.on('error', common.mustNotCall());
-2
View File
@@ -12,8 +12,6 @@ function test() {
socket2.close();
}));
}));
socket1.on('error', common.mustNotCall());
socket2.on('error', common.mustNotCall());
}
checkSupportReusePort().then(test, () => {
-2
View File
@@ -13,8 +13,6 @@ function test(host) {
server2.close();
}));
}));
server1.on('error', common.mustNotCall());
server2.on('error', common.mustNotCall());
}
checkSupportReusePort()