-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: Use countdown in test file #17646
Conversation
@@ -26,15 +26,8 @@ const server = http.createServer(function(req, res) { | |||
|
|||
// Just let the test terminate instead of hanging | |||
client.on('close', function() { | |||
if (received !== COUNT) | |||
if (countdown.remaining !== 0) | |||
server.close(); |
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.
@sreepurnajasti do you know why this is needed? Isn't the server.close()
above sufficient?
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 Thanks for the review. This block is used to close the server instead of hanging. However, conditional check may not be required. If it is also, its fine. So, let me know whether to make any changes!!
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.
The whole client.on('close')
block should be removed. Since there's now no process.on('exit')
check, we should let the test timeout if this isn't working correctly which would then signal that the test is broken.
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 @apapirovski Updated. Please review.
@@ -26,15 +26,8 @@ const server = http.createServer(function(req, res) { | |||
|
|||
// Just let the test terminate instead of hanging | |||
client.on('close', function() { | |||
if (received !== COUNT) | |||
if (countdown.remaining !== 0) | |||
server.close(); |
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.
The whole client.on('close')
block should be removed. Since there's now no process.on('exit')
check, we should let the test timeout if this isn't working correctly which would then signal that the test is broken.
52a4058
to
2879207
Compare
Landed as 0a28f94 |
Fixes: nodejs/node#17169 PR-URL: nodejs/node#17646 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Fixes: #17169
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)