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: improve multiple timers tests #14616

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 4, 2017

General improvements to various timers tests

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

tests

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 4, 2017
@jasnell jasnell force-pushed the improve-timers-tests branch from 2840276 to 94cd7f2 Compare August 4, 2017 01:10
@mscdex mscdex added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Aug 4, 2017
@jasnell
Copy link
Member Author

jasnell commented Aug 4, 2017

@jasnell jasnell requested review from Trott and addaleax August 4, 2017 20:36
@addaleax
Copy link
Member

addaleax commented Aug 4, 2017

@jasnell not before Monday. ;)

@jasnell
Copy link
Member Author

jasnell commented Aug 4, 2017

No worries! :-) enjoy your weekend!

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

non blocking nits

console.error('[FAIL] Interval fired %d/%d times.', nbIntervalFired, N);
throw new Error('Test timed out. keepOpen was not canceled.');
}, TEST_DURATION);
const keepOpen =
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This is an uncommon wrapping, IMHO

const keepOpen = setTimeout(
  common.mustNotCall('Test timed out. keepOpen was not canceled.'),
  TEST_DURATION
);

is more "regular".

Alltought

const keepOpenMsg = 'Test timed out. keepOpen was not canceled.'
const keepOpen = setTimeout(common.mustNotCall(keepOpenMsg), TEST_DURATION);

is usually my preference.

@@ -36,18 +36,14 @@ const assert = require('assert');
}

{
let ncalled = 0;
let ncalled = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: camelCase nCalled

jasnell added a commit that referenced this pull request Aug 8, 2017
PR-URL: #14616
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@jasnell
Copy link
Member Author

jasnell commented Aug 8, 2017

Landed in 7192e91

@jasnell jasnell closed this Aug 8, 2017
addaleax pushed a commit that referenced this pull request Aug 10, 2017
PR-URL: #14616
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@addaleax addaleax mentioned this pull request Aug 13, 2017
MylesBorins pushed a commit that referenced this pull request Sep 19, 2017
PR-URL: #14616
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Sep 20, 2017
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