-
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: run all of test-timers-blocking-callback #9305
Conversation
The test has two test cases, but only the first was being run due to a small bug. This change fixes the bug.
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.
Good catch, and my apologies again. This test is definitely not written in a way that makes it easy to reason about it.
These changes look good to me. Eventually it would be good to also assert on the number of blockingCallback
calls, but that can be done in a separate PR. This is already a significant improvement.
@@ -56,24 +56,24 @@ function blockingCallback(callback) { | |||
common.busyLoop(TIMEOUT); | |||
|
|||
timeCallbackScheduled = Timer.now(); | |||
setTimeout(blockingCallback, TIMEOUT); | |||
setTimeout(blockingCallback.bind(null, callback), TIMEOUT); |
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.
setTimeout(() => blockingCallback(callback), TIMEOUT);
?
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 did it this way to match what was already on line 67 so that it was clear that they were doing the same thing.
The test has two test cases, but only the first was being run due to a small bug. This change fixes the bug. PR-URL: nodejs#9305 Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in 2c6ca32 |
The test has two test cases, but only the first was being run due to a small bug. This change fixes the bug. PR-URL: #9305 Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The test has two test cases, but only the first was being run due to a small bug. This change fixes the bug. PR-URL: #9305 Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test timers
Description of change
The test has two test cases, but only the first was being run due to a
small bug. This change fixes the bug.
/cc @misterdjules
Refs: #8041