mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 15:32:15 +00:00

Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
32 lines
697 B
JavaScript
32 lines
697 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var cluster = require('cluster');
|
|
var domain = require('domain');
|
|
|
|
// RR is the default for v0.11.9+ so the following line is redundant:
|
|
// cluster.schedulingPolicy = cluster.SCHED_RR;
|
|
|
|
if (cluster.isWorker) {
|
|
var d = domain.create();
|
|
d.run(function() { });
|
|
|
|
var http = require('http');
|
|
http.Server(function() { }).listen(common.PORT, '127.0.0.1');
|
|
|
|
} else if (cluster.isMaster) {
|
|
var worker;
|
|
|
|
//Kill worker when listening
|
|
cluster.on('listening', function() {
|
|
worker.kill();
|
|
});
|
|
|
|
//Kill process when worker is killed
|
|
cluster.on('exit', function() {
|
|
process.exit(0);
|
|
});
|
|
|
|
//Create worker
|
|
worker = cluster.fork();
|
|
}
|