mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 13:05:07 +00:00

PR-URL: https://github.com/nodejs/node/pull/12441 Ref: https://github.com/nodejs/node/issues/12376 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
531 B
JavaScript
19 lines
531 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const cluster = require('cluster');
|
|
|
|
if (cluster.isMaster) {
|
|
const worker = cluster.fork();
|
|
worker.on('exit', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, 0, 'worker did not exit normally');
|
|
assert.strictEqual(signal, null, 'worker did not exit normally');
|
|
}));
|
|
} else {
|
|
const net = require('net');
|
|
const server = net.createServer();
|
|
server.listen(0, common.mustCall(() => {
|
|
process.disconnect();
|
|
}));
|
|
}
|