Browse Source

test: remove test-cluster-* var redeclarations

PR-URL: https://github.com/nodejs/node/pull/4980
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
process-exit-stdio-flushing
Rich Trott 9 years ago
committed by James M Snell
parent
commit
f7feab5b3b
  1. 6
      test/parallel/test-cluster-bind-twice.js
  2. 1
      test/parallel/test-cluster-dgram-2.js
  3. 4
      test/parallel/test-cluster-eaddrinuse.js

6
test/parallel/test-cluster-bind-twice.js

@ -51,7 +51,7 @@ if (!id) {
b.send('START'); b.send('START');
}); });
var ok = false; let ok = false;
b.on('message', function(m) { b.on('message', function(m) {
if (typeof m === 'object') return; // ignore system messages if (typeof m === 'object') return; // ignore system messages
@ -68,7 +68,7 @@ if (!id) {
else if (id === 'one') { else if (id === 'one') {
if (cluster.isMaster) return startWorker(); if (cluster.isMaster) return startWorker();
var server = http.createServer(common.fail).listen(common.PORT, function() { http.createServer(common.fail).listen(common.PORT, function() {
process.send('READY'); process.send('READY');
}); });
@ -79,7 +79,7 @@ else if (id === 'one') {
else if (id === 'two') { else if (id === 'two') {
if (cluster.isMaster) return startWorker(); if (cluster.isMaster) return startWorker();
var ok = false; let ok = false;
process.on('exit', function() { process.on('exit', function() {
assert(ok); assert(ok);
}); });

1
test/parallel/test-cluster-dgram-2.js

@ -20,7 +20,6 @@ else
function master() { function master() {
var i;
var received = 0; var received = 0;
// Start listening on a socket. // Start listening on a socket.

4
test/parallel/test-cluster-eaddrinuse.js

@ -11,7 +11,7 @@ var net = require('net');
var id = '' + process.argv[2]; var id = '' + process.argv[2];
if (id === 'undefined') { if (id === 'undefined') {
var server = net.createServer(common.fail); const server = net.createServer(common.fail);
server.listen(common.PORT, function() { server.listen(common.PORT, function() {
var worker = fork(__filename, ['worker']); var worker = fork(__filename, ['worker']);
worker.on('message', function(msg) { worker.on('message', function(msg) {
@ -23,7 +23,7 @@ if (id === 'undefined') {
}); });
} }
else if (id === 'worker') { else if (id === 'worker') {
var server = net.createServer(common.fail); let server = net.createServer(common.fail);
server.listen(common.PORT, common.fail); server.listen(common.PORT, common.fail);
server.on('error', common.mustCall(function(e) { server.on('error', common.mustCall(function(e) {
assert(e.code, 'EADDRINUSE'); assert(e.code, 'EADDRINUSE');

Loading…
Cancel
Save