| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This will no longer do what it claims to as the countdown is redeclared on each request. It will never go below 1 which means the callback will never fire.
In general, this test would be better if rewritten without Countdown and instead by using .once('request') with common.mustCall for the first test that would then declare on('request') with common.mustCall for the 2nd test.
Something like this basically:
server.once('request', common.mustCall((req, res) => {
server.on('request', common.mustCall((req, res) => {
res.end(Buffer.from('asdf'));
}));
// 1st test case code here
}));
Sorry, something went wrong.
There was a problem hiding this comment.
@apapirovski : Thanks for the feedback. I've updated the PR with the changes and also shortened the commit message. Kindly review the PR now. Thanks !
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
One quick note
Sorry, something went wrong.
There was a problem hiding this comment.
See line 23 -- common has already been required, but just not set to a variable.
Sorry, something went wrong.
There was a problem hiding this comment.
@maclover7 : Thanks for the feedback. I've updated the PR with the changes. Kindly review now and update the CI Checks. Thanks !
Sorry, something went wrong.
There was a problem hiding this comment.
The inclusion of common must be the first module loaded. Otherwise, it does not protect against leaked globals from other modules.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM once common is moved to be the first module loaded and if CI is OK.
Sorry, something went wrong.
|
@Trott : Thanks for the feedback. I've moved up common to be the first module loaded. Kindly review the PR now. Thanks ! |
Sorry, something went wrong.
Sorry, something went wrong.
|
@maclover7 : Curious why test/linux-one failed ? |
Sorry, something went wrong.
|
@mithunsasidharan It looks like it's an unrelated failure, and the rest of the CI is green, so things should be okay. |
Sorry, something went wrong.
|
@apapirovski : Can you please land this ? Thanks a lot ! |
Sorry, something went wrong.
|
Landed in bb59063 Thank you for your contribution! |
Sorry, something went wrong.
PR-URL: #17437 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17437 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17437 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17437 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #17437 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
| Back | FazBrowse Home | New Git URL |
refactored test case in test-http-res-write-end-dont-take-array to use common.mustCall as per issue #17169
Checklist
Affected core subsystem(s)
test