-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Conversation
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
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. |
|
||
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}/`); |
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: long line I guess linter is not happy :)
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.
Linter probably forgives it because it contains a URL. But it should probably be wrapped.
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.
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?
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.
Seems okay to me
Landed in af15b75 |
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 <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 packettest-net-localport
requires hardcoded port number for assertionsThis PR also updates
test-http-agent-uninitialized
andtest-http-agent-uninitialized-with-handle
to not usecommon.PORT
anymore.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test