-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 test-stream-big-push #10226
Conversation
* use common.mustCall() * specify setTimeout() duration of 1ms * remove unused `n` function argument
if (reads === 0) { | ||
setTimeout(function() { | ||
r.push(str); | ||
}); | ||
}, 1); |
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.
Just wondering, why are we doing these?
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.
Might just be me, but I find an unspecified duration or interval confusing. I always spend a moment wondering if it is a mistake. Did the original author simply forget to provide a value? Did they intend to use setImmediate()
or even process.nextTick()
instead of setTimeout()
? And so on. By making it explicit, we at least make it clear that a 1ms timer is what was intended and not an error.
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
@nodejs/streams |
Landed b79e83e CI issue is unrelated. |
* use common.mustCall() * specify setTimeout() duration of 1ms * remove unused `n` function argument PR-URL: #10226 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* use common.mustCall() * specify setTimeout() duration of 1ms * remove unused `n` function argument PR-URL: #10226 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* use common.mustCall() * specify setTimeout() duration of 1ms * remove unused `n` function argument PR-URL: #10226 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* use common.mustCall() * specify setTimeout() duration of 1ms * remove unused `n` function argument PR-URL: #10226 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* use common.mustCall() * specify setTimeout() duration of 1ms * remove unused `n` function argument PR-URL: #10226 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test stream
Description of change
n
function argument