Skip to content

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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@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