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: move common.PORT tests to sequential #15151

Closed
wants to merge 2 commits into from

Conversation

maclover7
Copy link
Contributor

@maclover7 maclover7 commented Sep 2, 2017

Reasons:

  • test-async-wrap-getasyncid binds a handle, so move to sequential because port cannot be already in use
    - test-dgram-implicit-bind-failure requires hardcoded port number to properly send socket packet
  • test-net-localport requires hardcoded port number for assertions

This PR also updates test-http-agent-uninitialized and test-http-agent-uninitialized-with-handle to not use common.PORT anymore.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Reasons:

- `test-async-wrap-getasyncid` binds a handle, so move to sequential because port cannot be already in use
-` test-dgram-implicit-bind-failure` requires hardcoded port number to properly send socket packet
- `test-http-agent-uninitialized-with-handle` requires hardcoded port number to properly send http request
- `test-http-agent-uninitialized` requires hardcoded port number to properly send http request
- `test-net-localport` requires hardcoded port number for assertions
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Sep 2, 2017
@mscdex mscdex added async_wrap dgram Issues and PRs related to the dgram subsystem / UDP. http Issues or PRs related to the http subsystem. net Issues and PRs related to the net subsystem. labels Sep 2, 2017
@lpinca
Copy link
Member

lpinca commented Sep 3, 2017

I think the http agent tests can be refactored to use a random available port.

@gibfahn
Copy link
Member

gibfahn commented Sep 3, 2017

I think the http agent tests can be refactored to use a random available port.

@maclover7 if you're up for this then great, otherwise I think it can probably be done in a follow-on PR.

@maclover7
Copy link
Contributor Author

👍 no problem, updated @gibfahn @lpinca


const server = http.createServer(common.mustCall((req, res) => {
res.end();
})).listen(common.PORT, common.mustCall(() => {
})).listen(0, common.mustCall(() => {
const req = new http.ClientRequest(`http://localhost:${server.address().port}/`);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: long line I guess linter is not happy :)

Copy link
Member

Choose a reason for hiding this comment

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

Linter probably forgives it because it contains a URL. But it should probably be wrapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make lint runs with no errors -- nothing to do here I guess? I know the line is 83 chars long, is it worth it move the URL string to a new line?

Copy link
Member

Choose a reason for hiding this comment

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

Seems okay to me

@BridgeAR
Copy link
Member

BridgeAR commented Sep 9, 2017

@BridgeAR
Copy link
Member

Landed in af15b75

@BridgeAR BridgeAR closed this Sep 11, 2017
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Sep 11, 2017
Reasons:

- `test-async-wrap-getasyncid` binds a handle, so move to
  sequential because port cannot be already in use.
- `test-dgram-implicit-bind-failure` requires a hardcoded
  port number to properly send socket packet.
- `test-http-agent-uninitialized-with-handle` requires a
  hardcoded port number to properly send http request.
- `test-http-agent-uninitialized` requires a hardcoded port
  number to properly send http request.
- `test-net-localport` requires a hardcoded port number
  for assertions.

In addition this replaces two common.PORTs with a dynamic port.

PR-URL: nodejs#15151
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@maclover7 maclover7 deleted the jm-comon-port-2 branch September 11, 2017 14:56
addaleax pushed a commit to addaleax/node that referenced this pull request Sep 13, 2017
Reasons:

- `test-async-wrap-getasyncid` binds a handle, so move to
  sequential because port cannot be already in use.
- `test-dgram-implicit-bind-failure` requires a hardcoded
  port number to properly send socket packet.
- `test-http-agent-uninitialized-with-handle` requires a
  hardcoded port number to properly send http request.
- `test-http-agent-uninitialized` requires a hardcoded port
  number to properly send http request.
- `test-net-localport` requires a hardcoded port number
  for assertions.

In addition this replaces two common.PORTs with a dynamic port.

PR-URL: nodejs#15151
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
jasnell pushed a commit that referenced this pull request Sep 20, 2017
Reasons:

- `test-async-wrap-getasyncid` binds a handle, so move to
  sequential because port cannot be already in use.
- `test-dgram-implicit-bind-failure` requires a hardcoded
  port number to properly send socket packet.
- `test-http-agent-uninitialized-with-handle` requires a
  hardcoded port number to properly send http request.
- `test-http-agent-uninitialized` requires a hardcoded port
  number to properly send http request.
- `test-net-localport` requires a hardcoded port number
  for assertions.

In addition this replaces two common.PORTs with a dynamic port.

PR-URL: #15151
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. http Issues or PRs related to the http subsystem. net Issues and PRs related to the net subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants