Skip to content

Commit

Permalink
test: verify IPC messages are emitted on next tick
Browse files Browse the repository at this point in the history
The test in this commit runs correctly if IPC messages are
properly consumed and emitted. Otherwise, the test times out.

Fixes: #6561
PR-URL: #6909
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
santigimeno authored and rvagg committed Jun 2, 2016
1 parent 27d0eb0 commit 4cc6a18
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/parallel/test-cluster-ipc-throw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';
const common = require('../common');
const http = require('http');
const cluster = require('cluster');

cluster.schedulingPolicy = cluster.SCHED_RR;

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 4cc6a18

Please sign in to comment.