Skip to content

Commit

Permalink
test: remove modifcation to common.PORT
Browse files Browse the repository at this point in the history
A possibly-buggy fixture server uses `common.PORT+1000` for its port
rather than `common.PORT`. That could result in it clashing with other
ports if tests are run in parallel. The test runner increments
`common.PORT` by 100 for each running instance for tests. Change to use
common.PORT and have the tests that use the fixture start with
common.PORT+1 for anything they need.

PR-URL: #6990
Refs: #6989
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
Trott authored and rvagg committed Jun 2, 2016
1 parent 79ad172 commit 0a258e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/fixtures/clustered-server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ if (cluster.isMaster) {
}
} else {
var server = http.createServer(handleRequest);
server.listen(common.PORT+1000);
server.listen(common.PORT);
}
2 changes: 1 addition & 1 deletion test/parallel/test-debug-port-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

const PORT_MIN = common.PORT;
const PORT_MIN = common.PORT + 1; // The fixture uses common.PORT.
const PORT_MAX = PORT_MIN + 2;

const args = [
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-debug-signal-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;

var port = common.PORT + 42;
var port = common.PORT + 1; // The fixture uses common.PORT.
var args = ['--debug-port=' + port,
common.fixturesDir + '/clustered-server/app.js'];
var options = { stdio: ['inherit', 'inherit', 'pipe', 'ipc'] };
Expand Down

0 comments on commit 0a258e5

Please sign in to comment.