Skip to content

test: improve multiple timers tests - #14616

Closed
jasnell wants to merge 1 commit into
nodejs:masterfrom
jasnell:improve-timers-tests
Closed

test: improve multiple timers tests#14616
jasnell wants to merge 1 commit into
nodejs:masterfrom
jasnell:improve-timers-tests

Conversation

@jasnell

Copy link
Copy Markdown
Member

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-botnodejs-github-bot added the test Issues and PRs related to the tests. label Aug 4, 2017
@jasnell
jasnellforce-pushed the improve-timers-tests branch from 2840276 to 94cd7f2CompareAugust 4, 2017 01:10
@mscdexmscdex added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Aug 4, 2017
@jasnell

Copy link
Copy Markdown
MemberAuthor

@jasnell
jasnell requested review from Trott and addaleaxAugust 4, 2017 20:36
@addaleax

Copy link
Copy Markdown
Member

@jasnell not before Monday. ;)

@jasnell

Copy link
Copy Markdown
MemberAuthor

No worries! :-) enjoy your weekend!

@refackrefack left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

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

is more "regular".

Alltought

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

is usually my preference.


{
let ncalled = 0;
let ncalled = 3;

Copy link
Copy Markdown
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 <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@jasnell

Copy link
Copy Markdown
MemberAuthor

Landed in 7192e91

@jasnelljasnell closed this Aug 8, 2017
addaleax pushed a commit that referenced this pull request Aug 10, 2017
PR-URL: #14616
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@addaleaxaddaleax 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 <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Sep 20, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testIssues and PRs related to the tests.timersIssues 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

@jasnell@addaleax@refack@mscdex@MylesBorins@nodejs-github-bot