Skip to content

Commit

Permalink
test: remove unneeded listeners
Browse files Browse the repository at this point in the history
Unhandled `'error'` events will make the process exit with an unclean
exit code anyway.

PR-URL: nodejs#55486
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
  • Loading branch information
lpinca authored and tpoisseau committed Nov 21, 2024
1 parent 7999723 commit 7292955
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-dgram-reuseport.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ const socket = dgram.createSocket(options);

socket.bind(+process.env.port, common.mustCall(() => {
socket.close();
})).on('error', common.mustNotCall());
}));
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-net-reuseport.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ const server = net.createServer();

server.listen({ ...options, port: +process.env.port }, common.mustCall(() => {
server.close();
})).on('error', common.mustNotCall());
}));
4 changes: 2 additions & 2 deletions test/parallel/test-cluster-dgram-reuseport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
});
3 changes: 0 additions & 3 deletions test/parallel/test-cluster-net-reuseport.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ server1.listen(options, common.mustCall(() => {
server2.close(close);
}));
}));

server1.on('error', common.mustNotCall());
server2.on('error', common.mustNotCall());
2 changes: 0 additions & 2 deletions test/parallel/test-dgram-reuseport.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ function test() {
socket2.close();
}));
}));
socket1.on('error', common.mustNotCall());
socket2.on('error', common.mustNotCall());
}

checkSupportReusePort().then(test, () => {
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-net-reuseport.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ function test(host) {
server2.close();
}));
}));
server1.on('error', common.mustNotCall());
server2.on('error', common.mustNotCall());
}

checkSupportReusePort()
Expand Down

0 comments on commit 7292955

Please sign in to comment.