blob: 378c4ef24df89688b58d5d16a05e4d3d93719cbd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
if (cluster.isPrimary) {
const worker = cluster.fork();
worker.on('exit', common.mustCall((code, signal) => {
assert.strictEqual(
code,
0,
`Worker did not exit normally with code: ${code}`
);
assert.strictEqual(
signal,
null,
`Worker did not exit normally with signal: ${signal}`
);
}));
} else {
const net = require('net');
const server = net.createServer();
server.listen(0, common.mustCall(() => {
process.disconnect();
}));
}
|