Skip to content

Commit c07eae8

Browse files
committed
test: add test for PR 6909
It runs correctly if the IPC messages are emitted in the nextTick. Otherwise, it never exits.
1 parent 62376d9 commit c07eae8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
const common = require('../common');
3+
const http = require('http');
4+
const cluster = require('cluster');
5+
6+
const server = http.createServer();
7+
if (cluster.isMaster) {
8+
server.listen(common.PORT);
9+
const worker = cluster.fork();
10+
worker.on('exit', common.mustCall(() => {
11+
server.close();
12+
}));
13+
} else {
14+
process.on('uncaughtException', common.mustCall((e) => {
15+
}));
16+
17+
server.listen(common.PORT);
18+
server.on('error', common.mustCall((e) => {
19+
cluster.worker.disconnect();
20+
throw e;
21+
}));
22+
}

0 commit comments

Comments
 (0)