mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 06:38:13 +00:00

common.js contains code that checks for variables leaking into the global namespace. Load common.js in all tests that do not intentionally leak variables. PR-URL: https://github.com/nodejs/node/pull/3095 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
17 lines
527 B
JavaScript
17 lines
527 B
JavaScript
'use strict';
|
|
require('../common');
|
|
var cluster = require('cluster');
|
|
|
|
if (cluster.isMaster) {
|
|
var worker = cluster.fork().on('online', disconnect);
|
|
|
|
function disconnect() {
|
|
worker.disconnect();
|
|
// The worker remains in cluster.workers until both disconnect AND exit.
|
|
// Disconnect is supposed to disconnect all workers, but not workers that
|
|
// are already disconnected, since calling disconnect() on an already
|
|
// disconnected worker would error.
|
|
worker.on('disconnect', cluster.disconnect);
|
|
}
|
|
}
|