Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: remove modifcation to common.PORT
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.

Refs: #6989
  • Loading branch information
Trott committed May 26, 2016
commit 46ae8226743651aed4837db848df6e863cbf0c49
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; // fixture uses common.PORT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be less confusing to assign to a special port in fixtures?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so too at first, but it turns out that the fixture uses a single port, while this uses use multiple ports. Less weird IMO to give the common.PORT to the fixture and let this use special ports rather than have both using special ports and needing to make sure that the special ports don't collide.

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; // fixture uses common.PORT
var args = ['--debug-port=' + port,
common.fixturesDir + '/clustered-server/app.js'];
var options = { stdio: ['inherit', 'inherit', 'pipe', 'ipc'] };
Expand Down