mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
02fe8215f0
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>
26 lines
523 B
JavaScript
26 lines
523 B
JavaScript
'use strict';
|
|
require('../common');
|
|
process.env.NODE_CLUSTER_SCHED_POLICY = 'none';
|
|
|
|
var cluster = require('cluster');
|
|
var net = require('net');
|
|
|
|
if (cluster.isMaster) {
|
|
var unbound = cluster.fork().on('online', bind);
|
|
|
|
function bind() {
|
|
cluster.fork({BOUND: 'y'}).on('listening', disconnect);
|
|
}
|
|
|
|
function disconnect() {
|
|
unbound.disconnect();
|
|
unbound.on('disconnect', cluster.disconnect);
|
|
}
|
|
} else {
|
|
if (process.env.BOUND === 'y') {
|
|
var source = net.createServer();
|
|
|
|
source.listen(0);
|
|
}
|
|
}
|