-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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 common.PORT to random port #13848
Conversation
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.
LGTM, thanks. Can you please amend your commit message so that it says common.PORT
instead of common.Port
, and the full commit message elaborates on what specific test was changed? Also, the reference to the issue should adhere to the Refs: https://github.com/nodejs/node/issues/12376
format. It can be fixed on landing as well, though.
Hi, I did the changes you asked and amended another test I reviewed all the testes needed changes on this issue and I think all of them fixed already, except those two Cheers |
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.
Nice work. Please feel free to also give us any feedback about the onboarding process today.
#goodnessSquad
@@ -37,7 +37,7 @@ const path = require('path'); | |||
const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); | |||
const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); | |||
|
|||
const options = {cert: cert, key: key, port: common.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.
I'm not sure this should be changed, it may change the reason of the connection failure.
@@ -51,7 +51,7 @@ const path = require('path'); | |||
const conn = tls.connect({ | |||
cert: cert, | |||
key: key, | |||
port: common.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.
Ditto
@@ -40,7 +40,7 @@ function test1() { | |||
}; | |||
|
|||
try { | |||
tls.connect(common.PORT); | |||
tls.connect(0); |
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.
Does it actually make sense to connect to port 0? Binding to port 0 allocates a free port but connecting to port 0 is not allowed in many programs. I guess because it is an invalid port so I'm not sure if it's ok here.
It might be better to just leave these tests as they are and move them to test/sequential
.
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.
Connecting to port 0 gives EADDRNOTAVAIL while connecting to a valid-but-not-listening port gives ECONNREFUSED. Moreover, using port 0 for connecting (as opposed to listening) is a bit nonsensical semantically. Thanks for the pull request, but this needs a different approach. (Easiest thing to do might be to simply move both tests as they currently exist to test/sequential
instead of test/parallel
. They can always be moved back to test/parallel
if someone finds a different solution.)
👍 |
Hi, @guylil! What do you say we try to get this thing across the finish line? Here's my recommendation:
Hope you're up for it! And if not, thanks for the pull request anyway! |
Pull request is against |
Addresses issue discussed in #12376
Test changed: test/parallel/test-tls-client-default-ciphers.js
This is my first contribution! #goodnessSquad
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)