Skip to content

Commit

Permalink
test: run all of test-timers-blocking-callback
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and Myles Borins committed Nov 22, 2016
1 parent 5eeac8c commit 4fcc2c1
Showing 1 changed file with 5 additions and 5 deletions.
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);
}
}

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

0 comments on commit 4fcc2c1

Please sign in to comment.