mirror of
https://github.com/nodejs/node.git
synced 2024-11-24 20:29:23 +01:00
5d559f4a74
PR-URL: https://github.com/nodejs/node/pull/41831 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
22 lines
573 B
JavaScript
22 lines
573 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const cluster = require('cluster');
|
|
const assert = require('assert');
|
|
|
|
if (cluster.isPrimary) {
|
|
const worker = cluster.fork();
|
|
|
|
worker.on('online', common.mustCall(() => {
|
|
// Use worker.process.kill() instead of worker.kill() because the latter
|
|
// waits for a graceful disconnect, which will never happen.
|
|
worker.process.kill();
|
|
}));
|
|
|
|
worker.on('exit', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, null);
|
|
assert.strictEqual(signal, 'SIGTERM');
|
|
}));
|
|
} else {
|
|
while (true);
|
|
}
|