Skip to content

Commit 8c2fc11

Browse files
lpincaruyadorno
authored andcommitted
test: remove unneeded listeners
Unhandled `'error'` events will make the process exit with an unclean exit code anyway. PR-URL: #55486 Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 91fdec3 commit 8c2fc11

6 files changed

+4
-11
lines changed

test/parallel/test-child-process-dgram-reuseport.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ const socket = dgram.createSocket(options);
3232

3333
socket.bind(+process.env.port, common.mustCall(() => {
3434
socket.close();
35-
})).on('error', common.mustNotCall());
35+
}));

test/parallel/test-child-process-net-reuseport.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ const server = net.createServer();
3232

3333
server.listen({ ...options, port: +process.env.port }, common.mustCall(() => {
3434
server.close();
35-
})).on('error', common.mustNotCall());
35+
}));

test/parallel/test-cluster-dgram-reuseport.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ socket1.bind(0, () => {
3535
socket2.bind(socket1.address().port, () => {
3636
socket1.close(close);
3737
socket2.close(close);
38-
}).on('error', common.mustNotCall());
39-
}).on('error', common.mustNotCall());
38+
});
39+
});

test/parallel/test-cluster-net-reuseport.js

-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ server1.listen(options, common.mustCall(() => {
3636
server2.close(close);
3737
}));
3838
}));
39-
40-
server1.on('error', common.mustNotCall());
41-
server2.on('error', common.mustNotCall());

test/parallel/test-dgram-reuseport.js

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ function test() {
1212
socket2.close();
1313
}));
1414
}));
15-
socket1.on('error', common.mustNotCall());
16-
socket2.on('error', common.mustNotCall());
1715
}
1816

1917
checkSupportReusePort().then(test, () => {

test/parallel/test-net-reuseport.js

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ function test(host) {
1313
server2.close();
1414
}));
1515
}));
16-
server1.on('error', common.mustNotCall());
17-
server2.on('error', common.mustNotCall());
1816
}
1917

2018
checkSupportReusePort()

0 commit comments

Comments
 (0)