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: refactor test-http-hostname-typechecking #13993

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Jun 29, 2017

  • Use common.mustCall() to confirm callback is invoked.
  • Change spacing of require statements to conform to test-writing guide.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test http

* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.
@Trott Trott added http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests. labels Jun 29, 2017
@Trott
Copy link
Member Author

Trott commented Jun 30, 2017

@Trott
Copy link
Member Author

Trott commented Jul 2, 2017

Landed in 5bbae25

@Trott Trott closed this Jul 2, 2017
Trott added a commit that referenced this pull request Jul 2, 2017
* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.

PR-URL: #13993
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
http.request({hostname: v}).on('error', common.noop).end();
http.request({host: v}).on('error', common.noop).end();
http.request({hostname: v}).on('error', common.mustCall()).end();
http.request({host: v}).on('error', common.mustCall()).end();
Copy link
Member

Choose a reason for hiding this comment

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

I think I ran into an issue like this before; the thing is, this is not guaranteed to fail, since the machine running the tests may have an HTTP server running on port 80.

@Trott Any suggestions? Can/should we revert this? The next-best alternative would be trying to allocate a port by creating a server, then closing it and trying to use that as the por value (or actually run an HTTP server that serves proper responses?).

Copy link
Member Author

Choose a reason for hiding this comment

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

@addaleax My inclination would be to change common.mustCall() to () => {} to preserve the previous behavior. Perhaps bonus points for rethrowing the error if it's not ECONNREFUSED.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

(Oh! Reverting this one won't work because common.noop is no longer A Thing. So #14065 is probably the closest thing to a revert.)

addaleax pushed a commit that referenced this pull request Jul 11, 2017
* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.

PR-URL: #13993
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@addaleax addaleax mentioned this pull request Jul 11, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.

PR-URL: #13993
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.

PR-URL: #13993
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@Trott Trott deleted the test-http-hostname-typechecking branch January 13, 2022 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants