test: Fix common.PIPE to be process unique#14168
Conversation
test/common/index.js
Outdated
There was a problem hiding this comment.
Since the const are only used locally and there's a single exported side-effect (exports.PIPE = ...) IMHO it's cleaner.
Similar to the function setupFoo(); setupFoo(); approach in node_bootstap.js
Maybe even V8 will inline the consts ?
There was a problem hiding this comment.
I like it, easier to see that the consts aren't used except in exports.PIPE.
test/common/index.js
Outdated
There was a problem hiding this comment.
Not a huge fan of !! outside of minimal code competitions.
Willing to change if anyone has a strong opinion.
There was a problem hiding this comment.
No strong opinion from me. I think it used to be preferred in hot paths for performance. No idea if that's still the case. Regardless, it's totally sensible to value readable code over performant code in test/common/index.js.
|
Failures: |
|
For the commit message, maybe: |
cb47882 to
9c9ecac
Compare
* includes a tiny bit of refactoring in adjacent lines. * fixes 1 test and 1 benchmark that depended on PIPE being constant. PR-URL: nodejs#14168 Fixes: nodejs#14128 Reviewed-By: James M Snell <[email protected]>
9c9ecac to
c34ae48
Compare
* includes a tiny bit of refactoring in adjacent lines. * fixes 1 test and 1 benchmark that depended on PIPE being constant. PR-URL: #14168 Fixes: #14128 Reviewed-By: James M Snell <[email protected]>
* includes a tiny bit of refactoring in adjacent lines. * fixes 1 test and 1 benchmark that depended on PIPE being constant. PR-URL: #14168 Fixes: #14128 Reviewed-By: James M Snell <[email protected]>
|
This does not land cleanly in LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported |
common.PIPEto be process uniqueFixes: #14128
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test,stream,net