Skip to content

Commit

Permalink
test: add test for PR 6909
Browse files Browse the repository at this point in the history
It runs correctly if the IPC messages are emitted in the nextTick.
Otherwise, it never exits.
  • Loading branch information
santigimeno committed May 21, 2016
1 parent 62376d9 commit c07eae8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/parallel/test-cluster-ipc-throw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';
const common = require('../common');
const http = require('http');
const cluster = require('cluster');

const server = http.createServer();
if (cluster.isMaster) {
server.listen(common.PORT);
const worker = cluster.fork();
worker.on('exit', common.mustCall(() => {
server.close();
}));
} else {
process.on('uncaughtException', common.mustCall((e) => {
}));

server.listen(common.PORT);
server.on('error', common.mustCall((e) => {
cluster.worker.disconnect();
throw e;
}));
}

0 comments on commit c07eae8

Please sign in to comment.