Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/parallel/test-timers-blocking-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,24 @@ function blockingCallback(callback) {
common.busyLoop(TIMEOUT);

timeCallbackScheduled = Timer.now();
setTimeout(blockingCallback, TIMEOUT);
setTimeout(blockingCallback.bind(null, callback), TIMEOUT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTimeout(() => blockingCallback(callback), TIMEOUT); ?

Copy link
Member Author

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.

}
}

function testAddingTimerToEmptyTimersList(callback) {
const testAddingTimerToEmptyTimersList = common.mustCall(function(callback) {
initTest();
// Call setTimeout just once to make sure the timers list is
// empty when blockingCallback is called.
setTimeout(blockingCallback.bind(null, callback), TIMEOUT);
}
});

function testAddingTimerToNonEmptyTimersList() {
const testAddingTimerToNonEmptyTimersList = common.mustCall(function() {
initTest();
// Call setTimeout twice with the same timeout to make
// sure the timers list is not empty when blockingCallback is called.
setTimeout(blockingCallback, TIMEOUT);
setTimeout(blockingCallback, TIMEOUT);
}
});

// Run the test for the empty timers list case, and then for the non-empty
// timers list one
Expand Down