Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-cluster-disconnect-idle-worker.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e3ad91ad10238efbe3cc3c369becc43d605f62f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
const fork = cluster.fork;

if (cluster.isMaster) {
  fork(); // it is intentionally called `fork` instead of
  fork(); // `cluster.fork` to test that `this` is not used
  cluster.disconnect(common.mustCall(() => {
    assert.deepStrictEqual(Object.keys(cluster.workers), []);
  }));
}