Skip to content

Commit b2f60cb

Browse files
committed
test: test for the exitedAfterDisconnect default value
The test checka for the exit code of the worker. cluster on exit must be called. And the value for exitedAfterDisconnect should be false Fixes: nodejs#28837 Refs: nodejs#3743
1 parent 830e98a commit b2f60cb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// Test should fail in Node.js 5.4.1 and pass in later versions.
6+
7+
const assert = require('assert');
8+
const cluster = require('cluster');
9+
10+
if (cluster.isMaster) {
11+
cluster.on('exit', common.mustCall((worker, code) => {
12+
assert.strictEqual(code, 0, `worker exited with code: ${code}, expected 0`);
13+
assert.strictEqual(worker.exitedAfterDisconnect, false);
14+
}));
15+
16+
return cluster.fork();
17+
}
18+
19+
process.exit(0);

0 commit comments

Comments
 (0)