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:
parent
8aac7da7d6
commit
84fe809535
@ -32,4 +32,4 @@ const socket = dgram.createSocket(options);
|
|||||||
|
|
||||||
socket.bind(+process.env.port, common.mustCall(() => {
|
socket.bind(+process.env.port, common.mustCall(() => {
|
||||||
socket.close();
|
socket.close();
|
||||||
})).on('error', common.mustNotCall());
|
}));
|
||||||
|
@ -32,4 +32,4 @@ const server = net.createServer();
|
|||||||
|
|
||||||
server.listen({ ...options, port: +process.env.port }, common.mustCall(() => {
|
server.listen({ ...options, port: +process.env.port }, common.mustCall(() => {
|
||||||
server.close();
|
server.close();
|
||||||
})).on('error', common.mustNotCall());
|
}));
|
||||||
|
@ -35,5 +35,5 @@ socket1.bind(0, () => {
|
|||||||
socket2.bind(socket1.address().port, () => {
|
socket2.bind(socket1.address().port, () => {
|
||||||
socket1.close(close);
|
socket1.close(close);
|
||||||
socket2.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);
|
server2.close(close);
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
server1.on('error', common.mustNotCall());
|
|
||||||
server2.on('error', common.mustNotCall());
|
|
||||||
|
@ -12,8 +12,6 @@ function test() {
|
|||||||
socket2.close();
|
socket2.close();
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
socket1.on('error', common.mustNotCall());
|
|
||||||
socket2.on('error', common.mustNotCall());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkSupportReusePort().then(test, () => {
|
checkSupportReusePort().then(test, () => {
|
||||||
|
@ -13,8 +13,6 @@ function test(host) {
|
|||||||
server2.close();
|
server2.close();
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
server1.on('error', common.mustNotCall());
|
|
||||||
server2.on('error', common.mustNotCall());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkSupportReusePort()
|
checkSupportReusePort()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user