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

test-cluster-setup-master-argv.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ba6b366bbe3d08b4d2027060e6ab7ce1240a36a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');

setTimeout(common.mustNotCall('setup not emitted'), 1000).unref();

cluster.on('setup', common.mustCall(function() {
  const clusterArgs = cluster.settings.args;
  const realArgs = process.argv;
  assert.strictEqual(clusterArgs[clusterArgs.length - 1],
                     realArgs[realArgs.length - 1]);
}));

assert.notStrictEqual(process.argv[process.argv.length - 1], 'OMG,OMG');
process.argv.push('OMG,OMG');
process.argv.push('OMG,OMG');
cluster.setupMaster();