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: update test-timers-block-eventloop.js #16314

Closed
wants to merge 1 commit into from

Conversation

zhangzifa
Copy link
Contributor

When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

Fixes: #16310

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 19, 2017
@@ -11,7 +11,7 @@ const t2 = setInterval(() => {
common.busyLoop(15);
}, 10);

const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 100);
const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 200);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: it might make sense to use common.platformTimeout() everywhere and keep the original values. Not sure if it is enough though.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also prefer common.platformTimeout() if that works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it with common.platformTimeout just now. Behavior is the same with 100. I will update the case with 200 and common.platformTimeout togegher.

@mscdex mscdex added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Oct 19, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

Fixes: nodejs#16310
common.busyLoop(12);
}, 10);
common.busyLoop(commonTimeout(12));
}, common.platformTimeout(10));
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, maybe use commonTimeout() here too.


const t1 = setInterval(() => {
common.busyLoop(12);
}, 10);
common.busyLoop(commonTimeout(12));
Copy link
Member

@lpinca lpinca Oct 20, 2017

Choose a reason for hiding this comment

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

I'm not sure we should use common.platformTimeout() here. I think we don't want to increase the duration of the "busy" loop.

Edit: nvm this is probably correct or we will test something different from the original.

@joyeecheung
Copy link
Member

joyeecheung commented Oct 28, 2017

The stress tests did not reproduce the flakiness. Should we still merge this?

Also this just showed up in a Windows CI, and I am fairly certain that I had seen this on other platforms in the past week when I took a stroll in the CI:

https://ci.nodejs.org/job/node-test-binary-windows/12274/COMPILED_BY=vs2017,RUNNER=win2016,RUN_SUBSET=1/console

not ok 510 sequential/test-timers-block-eventloop
  ---
  duration_ms: 0.293
  severity: fail
  stack: |-
    assert.js:42
      throw new errors.AssertionError({
      ^
    
    AssertionError [ERR_ASSERTION]: eventloop blocked!
        at Timeout.mustNotCall [as _onTimeout] (c:\workspace\node-test-binary-windows\test\common\index.js:584:12)
        at ontimeout (timers.js:478:11)
        at tryOnTimeout (timers.js:302:5)
        at Timer.listOnTimeout (timers.js:262:5)
  ...

@refack
Copy link
Contributor

refack commented Oct 28, 2017

The stress tests did not reproduce the flakiness. Should we still merge this?

Probably stress wasn't rigorous enough. Seems like test is just too sensitive. I confirmed test after change fails 100% on pre-patched version.

P.S. I've also seens this on https://ci.nodejs.org/job/node-test-binary-arm/11283/RUN_SUBSET=3,label=pi3-raspbian-jessie/console

@refack
Copy link
Contributor

refack commented Oct 28, 2017

@refack refack self-assigned this Oct 28, 2017
refack pushed a commit to refack/node that referenced this pull request Oct 29, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: nodejs#16314
Fixes: nodejs#16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@refack
Copy link
Contributor

refack commented Oct 29, 2017

Landed in 83b8474 (nit fixed)

@refack refack closed this Oct 29, 2017
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: #16314
Fixes: #16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: #16314
Fixes: #16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
gibfahn pushed a commit that referenced this pull request Oct 31, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: #16314
Fixes: #16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@gibfahn gibfahn mentioned this pull request Oct 31, 2017
Qard pushed a commit to ayojs/ayo that referenced this pull request Nov 2, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: nodejs/node#16314
Fixes: nodejs/node#16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: #16314
Fixes: #16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: #16314
Fixes: #16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: #16314
Fixes: #16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
When CPU is busy, the above sequential case fails occasionally,
expand the timeout value to fix it.

PR-URL: nodejs/node#16314
Fixes: nodejs/node#16310
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@refack refack removed their assignment Oct 12, 2018
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.

Flaky test-timers-block-eventloop