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

Conversation

Trott
Copy link
Member

@Trott Trott commented Oct 26, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected 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

The test has two test cases, but only the first was being run due to a
small bug. This change fixes the bug.
@Trott Trott added timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. test Issues and PRs related to the tests. labels Oct 26, 2016
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 26, 2016
Copy link

@misterdjules misterdjules left a 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);
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.

@Trott
Copy link
Member Author

Trott commented Oct 28, 2016

Trott added a commit to Trott/io.js that referenced this pull request Oct 29, 2016
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@Trott
Copy link
Member Author

Trott commented Oct 29, 2016

Landed in 2c6ca32

@Trott Trott closed this Oct 29, 2016
evanlucas pushed a commit that referenced this pull request Nov 3, 2016
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]>
MylesBorins pushed a commit that referenced this pull request Nov 22, 2016
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]>
@MylesBorins MylesBorins mentioned this pull request Nov 22, 2016
@Trott Trott deleted the two-tests branch January 13, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants