mirror of https://github.com/lukechilds/node.git
Browse Source
The test in this commit runs correctly if IPC messages are properly consumed and emitted. Otherwise, the test times out. Fixes: https://github.com/nodejs/node/issues/6561 PR-URL: https://github.com/nodejs/node/pull/6909 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>v4.x
Santiago Gimeno
9 years ago
committed by
Myles Borins
1 changed files with 23 additions and 0 deletions
@ -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; |
||||
|
})); |
||||
|
} |
Loading…
Reference in new issue