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

tools,test: throw if common.PORT used in parallel tests #17559

Closed
wants to merge 2 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 9, 2017

common.PORT should not be used in parallelized tests. (There can be a
port collision if another tests requests an arbitrary open port from the
operating system and ends up getting common.PORT before a test that uses
common.PORT uses the port.) In such a situation, throw an error.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test tools

@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory. labels Dec 9, 2017
@Trott Trott added the python PRs and issues that require attention from people who are familiar with Python. label Dec 9, 2017
@Trott
Copy link
Member Author

Trott commented Dec 9, 2017

# PORT should match the definition in test/common/index.js.
env = { 'PORT': int(os.getenv('NODE_COMMON_PORT', '12346')) }
env['PORT'] += self.thread_id * 100
env = { }
Copy link
Contributor

Choose a reason for hiding this comment

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

Can env and the later .format() call be removed now, since env is now empty? For reference, was introduced in 782620f.

Copy link
Member Author

Choose a reason for hiding this comment

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

@maclover7 Sure seems like it. Will rebase, make that change, test, and force push....

common.PORT is no longer used in parallelized tests and should not be.
Remove code that accommodates parallelized tests.
common.PORT should not be used in parallelized tests. (There can be a
port collision if another tests requests an arbitrary open port from the
operating system and ends up getting common.PORT before a test that uses
common.PORT uses the port.) In such a situation, throw an error.
@Trott
Copy link
Member Author

Trott commented Dec 9, 2017

@Trott
Copy link
Member Author

Trott commented Dec 10, 2017

@Trott
Copy link
Member Author

Trott commented Dec 11, 2017

Re-running Linux CI only just to make sure the Fedora 24 issue is only the usual flaky test (got a PR in to fix one of 'em already): https://ci.nodejs.org/job/node-test-commit-linux/14880/

Trott added a commit to Trott/io.js that referenced this pull request Dec 12, 2017
common.PORT is no longer used in parallelized tests and should not be.
Remove code that accommodates parallelized tests.

PR-URL: nodejs#17559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Trott added a commit to Trott/io.js that referenced this pull request Dec 12, 2017
common.PORT should not be used in parallelized tests. (There can be a
port collision if another tests requests an arbitrary open port from the
operating system and ends up getting common.PORT before a test that uses
common.PORT uses the port.) In such a situation, throw an error.

PR-URL: nodejs#17559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@Trott
Copy link
Member Author

Trott commented Dec 12, 2017

Landed in 3674bee and 800ce94

@Trott Trott closed this Dec 12, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
common.PORT is no longer used in parallelized tests and should not be.
Remove code that accommodates parallelized tests.

PR-URL: #17559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
common.PORT should not be used in parallelized tests. (There can be a
port collision if another tests requests an arbitrary open port from the
operating system and ends up getting common.PORT before a test that uses
common.PORT uses the port.) In such a situation, throw an error.

PR-URL: #17559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
common.PORT is no longer used in parallelized tests and should not be.
Remove code that accommodates parallelized tests.

PR-URL: #17559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
common.PORT should not be used in parallelized tests. (There can be a
port collision if another tests requests an arbitrary open port from the
operating system and ends up getting common.PORT before a test that uses
common.PORT uses the port.) In such a situation, throw an error.

PR-URL: #17559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
@gibfahn
Copy link
Member

gibfahn commented Dec 20, 2017

Could this be backported to v6.x and v8.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

@Trott Trott deleted the common-port-stuff branch January 13, 2022 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python PRs and issues that require attention from people who are familiar with Python. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants