Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove modifcation to common.PORT #6990

Closed
wants to merge 2 commits into from
Closed

Conversation

Trott
Copy link
Member

@Trott Trott commented May 26, 2016

Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

test debugger

Description of change

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

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: nodejs#6989
@Trott Trott added debugger test Issues and PRs related to the tests. labels May 26, 2016
@Trott
Copy link
Member Author

Trott commented May 26, 2016

/cc @rvagg

@MylesBorins
Copy link
Contributor

@Trott LGTM

It seems like there are a few other instances... specifically in the debugger tests... would you be open to changing all of these instances in this PR?

@bnoordhuis
Copy link
Member

My grep fu finds these:

$ git grep -P 'PORT\s*\+\s*\d\d+' test/
test/debugger/helper-debugger-repl.js:var port = common.PORT + 1337;
test/debugger/test-debugger-client.js:var debugPort = common.PORT + 1337;
test/fixtures/clustered-server/app.js:  server.listen(common.PORT+1000);
test/parallel/test-debug-signal-cluster.js:var port = common.PORT + 42;

There are several more that add a single digit number but those look Mostly Harmless.

The changes in this PR LGTM although comments should preferably be capitalized and punctuated and have two spaces before the //.

@santigimeno
Copy link
Member

LGTM

@mscdex
Copy link
Contributor

mscdex commented May 26, 2016

Why not take this opportunity to just use 0 for the port and let the OS assign one? Death to common.PORT!

@cjihrig
Copy link
Contributor

cjihrig commented May 26, 2016

LGTM

@Trott
Copy link
Member Author

Trott commented May 26, 2016

Why not take this opportunity to just use 0 for the port and let the OS assign one? Death to common.PORT!

If that works, that would also solve the problem where one test doesn't clean up after itself and subsequent tests start getting EADDRINUSE errors.

@bnoordhuis
Copy link
Member

That won't work for debugger tests until #5025 lands. Dusting off that PR is on my TODO list, though.

@mhdawson
Copy link
Member

LGTM

@@ -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
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
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.

@Trott
Copy link
Member Author

Trott commented May 28, 2016

@Trott
Copy link
Member Author

Trott commented May 29, 2016

CI again, although fail on Raspberry Pi is certainly unrelated: https://ci.nodejs.org/job/node-test-pull-request/2843/

Trott added a commit to Trott/io.js that referenced this pull request May 29, 2016
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: nodejs#6990
Refs: nodejs#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>
@Trott
Copy link
Member Author

Trott commented May 29, 2016

Landed in bddfe63

@thealphanerd @bnoordhuis I'll pick off the remaining instances in a subsequent PR.

@Trott Trott closed this May 29, 2016
Trott added a commit to Trott/io.js that referenced this pull request May 29, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

Refs: nodejs#6990
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request May 30, 2016
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: nodejs#6990
Refs: nodejs#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>
Trott added a commit to Trott/io.js that referenced this pull request Jun 2, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: nodejs#7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: nodejs#6990
rvagg pushed a commit that referenced this pull request Jun 2, 2016
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>
rvagg pushed a commit that referenced this pull request Jun 2, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: #7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #6990
MylesBorins pushed a commit that referenced this pull request Jul 11, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: #7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #6990
MylesBorins pushed a commit that referenced this pull request Jul 12, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jul 12, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: #7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #6990
MylesBorins pushed a commit that referenced this pull request Jul 12, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jul 12, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: #7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #6990
@MylesBorins MylesBorins mentioned this pull request Jul 12, 2016
MylesBorins pushed a commit that referenced this pull request Jul 14, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jul 14, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: #7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #6990
MylesBorins pushed a commit that referenced this pull request Jul 14, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jul 14, 2016
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: #7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: #6990
@Trott Trott deleted the no-plus branch January 13, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants