-
Notifications
You must be signed in to change notification settings - Fork 30k
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: fixup test-http-hostname-typechecking #12627
Conversation
CI: https://ci.nodejs.org/job/node-test-pull-request/7655/ I’d be very okay with fast-tracking to unbreak master. |
77b9eb3
to
450014a
Compare
// These values are OK and should not throw synchronously | ||
['', undefined, null].forEach((v) => { | ||
assert.doesNotThrow(() => { | ||
http.request({hostname: v}).on('error', common.noop); | ||
http.request({host: v}).on('error', common.noop); | ||
reqs.push(http.request({hostname: v}).on('error', common.noop)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: any reason for preferring this over a simple .end()
on the original version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpinca See @jasnell’s comment in #12494 (comment) … I tried to keep this bit of the test just testing what it’s supposed to. Personally, I would totally be fine with having .end()
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax not sure I understand.
http.request({hostname: v}).on('error', common.noop).end();
would still work as intended no? The error
event would still be emitted. It should only check that it doesn't throw synchronously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
450014a
to
9c38c47
Compare
This test would currently create HTTP requests to localhost:80 and would time out on machines that actually had an server listening there. To address that, `end()` the requests that are generated. PR-URL: nodejs#12627 Ref: nodejs#12494
9c38c47
to
0229581
Compare
Lgtm |
Landed in 28f535a |
This test would currently create HTTP requests to localhost:80 and would time out on machines that actually had an server listening there. To address that, `end()` the requests that are generated. PR-URL: #12627 Ref: #12494 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Depends on #12494 which is |
This test would currently create HTTP requests to localhost:80
and would time out on machines that actually had an server listening
there.
To address that,
end()
the requests that are generated./cc @jasnell
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test