Skip to content

Flaky test-timers-block-eventloop #16310

Closed

Description

@targos

Test added in #15072

Example failure:
https://ci.nodejs.org/job/node-test-commit-linuxone/9533/nodes=rhel72-s390x/console

not ok 1945 sequential/test-timers-block-eventloop
  ---
  duration_ms: 0.440
  severity: fail
  stack: |-
    assert.js:45
      throw new errors.AssertionError({
      ^
    
    AssertionError [ERR_ASSERTION]: eventloop blocked!
        at Timeout.mustNotCall [as _onTimeout] (/data/iojs/build/workspace/node-test-commit-linuxone/nodes/rhel72-s390x/test/common/index.js:571:12)
        at ontimeout (timers.js:478:11)
        at tryOnTimeout (timers.js:302:5)
        at Timer.listOnTimeout (timers.js:262:5)
  ...

Activity

  1. added
    flaky-test
    timers
    test
    on Oct 19, 2017
  2. gireeshpunathil commented on Oct 19, 2017

    @gireeshpunathil
    Member

    /cc @nodejs/platform-s390

  3. gireeshpunathil commented on Oct 19, 2017

    @gireeshpunathil
    Member

    I guess the reported error is on RHEL on S390

  4. zhangzifa commented on Oct 19, 2017

    @zhangzifa
    Contributor

    @targos and @gireeshpunathil
    I reproduce this at my laptop(thinkpad x240/ubuntu 16.04) with the following steps:

    1. start 4 processes to occupy the cpu while(1);
    2. run the test case every other second.
    3. the error may happen every 10 times running the case.

    So I guess maybe the test server was busy when this happens.

    Fix is easy: just change the t3 timeout to 200ms.

    --- a/test/sequential/test-timers-block-eventloop.js
    +++ b/test/sequential/test-timers-block-eventloop.js
    @@ -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);
  5. zhangzifa commented on Oct 19, 2017

    @zhangzifa
    Contributor

    With this fix, failures does not happen after 1000 times running. Is a PR needed?

  6. gireeshpunathil commented on Oct 19, 2017

    @gireeshpunathil
    Member

    @zhangzifa - makes sense, the test seem to be walking on a ridge with high sensitivity on the timing of events that does not account into the environmental factors in the system. While we wait to hear from @nodejs/platform-s390 this experiment and the proposal thereon looks reasonable to me, thanks!

  7. mhdawson commented on Oct 19, 2017

    @mhdawson
    Member

    @jBarz can you take a look and comment.

  8. jBarz commented on Oct 20, 2017

    @jBarz
    Contributor

    It seems like we are depending on the following fs.stat call to callback within 50 milliseconds. Otherwise the test fails.

    fs.stat('./nonexistent.txt', (err, stats) => {...}

    Increasing the timeout is one way to fix this.
    @zhangzifa , could we stat something like /dev/zero which won't depend on the speed of the filesystem mount?

  9. zhangzifa commented on Oct 20, 2017

    @zhangzifa
    Contributor

    @jBarz I tested just now with /dev/zero, anyway, it still fails occasionally when cpu is busy. Anyway, I will update the case to /dev/nonexistent

  10. gibfahn commented on Oct 20, 2017

    @gibfahn
    Member

    @zhangzifa a PR would be great.

  11. zhangzifa commented on Oct 20, 2017

    @zhangzifa
    Contributor

    @gibfahn 16314 is there now.

  12. 1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky-testtesttimers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions