mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
78954846c3
PR-URL: https://github.com/nodejs/node/pull/46161 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
24 lines
542 B
JavaScript
24 lines
542 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const cluster = require('cluster');
|
|
const net = require('net');
|
|
const assert = require('assert');
|
|
|
|
cluster.schedulingPolicy = cluster.SCHED_RR;
|
|
|
|
if (cluster.isPrimary) {
|
|
let exited = false;
|
|
const worker = cluster.fork();
|
|
worker.on('exit', () => {
|
|
exited = true;
|
|
});
|
|
setTimeout(() => {
|
|
assert.ok(!exited);
|
|
worker.kill();
|
|
}, 3000);
|
|
} else {
|
|
const server = net.createServer(common.mustNotCall());
|
|
server.listen(0, common.mustCall(() => process.channel.unref()));
|
|
}
|