Skip to content

investigate flaky test-worker-ref-onexit #26167

Description

@Trott

Haven't seen this one before. Might be difficult to reproduce (but I haven't tried yet).

https://ci.nodejs.org/job/node-test-commit-aix/21132/nodes=aix61-ppc64/console

test-osuosl-aix61-ppc64_be-1

09:04:17 not ok 2174 parallel/test-worker-ref-onexit
09:04:17   ---
09:04:17   duration_ms: 2.331
09:04:17   severity: fail
09:04:17   exitcode: 1
09:04:17   stack: |-
09:04:17     assert.js:128
09:04:17       throw err;
09:04:17       ^
09:04:17     
09:04:17     AssertionError [ERR_ASSERTION]: function should not have been called at /home/iojs/build/workspace/node-test-commit-aix/nodes/aix61-ppc64/test/parallel/test-worker-ref-onexit.js:10
09:04:17         at Worker.mustNotCall (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix61-ppc64/test/common/index.js:425:12)
09:04:17         at Worker.emit (events.js:197:13)
09:04:17         at Worker.[kOnExit] (internal/worker.js:130:10)
09:04:17         at Worker.(anonymous function).onexit (internal/worker.js:82:51)
09:04:17   ...

Activity

  1. added
    testIssues and PRs related to Node.js core tests and test infrastructure.
    flaky-testIssues and PRs involving tests that fail intermittently in CI.
    workerIssues and PRs related to the worker_threads module and Worker API.
    on Feb 17, 2019
  2. addaleax commented on Feb 17, 2019

    @addaleax
    Member

    See also #26083 (comment) … if this is an AIX-specific problem (which I guess it could be?), I’m not sure how to best debug it.

    One idea could be that the Worker finishes before the current event loop turn is over. Something like this might fix it?

    diff --git a/test/parallel/test-worker-ref-onexit.js b/test/parallel/test-worker-ref-onexit.js
    index 0250c592ce91..968f0fe31e9e 100644
    --- a/test/parallel/test-worker-ref-onexit.js
    +++ b/test/parallel/test-worker-ref-onexit.js
    @@ -5,6 +5,6 @@ const { Worker } = require('worker_threads');
     // Check that worker.unref() makes the 'exit' event not be emitted, if it is
     // the only thing we would otherwise be waiting for.
     
    -const w = new Worker('', { eval: true });
    +const w = new Worker('while(true);', { eval: true });
     w.unref();
     w.on('exit', common.mustNotCall());
  3. addaleax commented on Feb 17, 2019

    @addaleax
    Member

    AIX stress test with 1000 runs: https://ci.nodejs.org/job/node-stress-single-test/2157/ (failed 34/267)
    Edit: Stress test with proposed solution: https://ci.nodejs.org/job/node-stress-single-test/2158/

  4. added a commit that references this issue on Feb 28, 2019
  5. added a commit that references this issue on Jul 27, 2026
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-testIssues and PRs involving tests that fail intermittently in CI.testIssues and PRs related to Node.js core tests and test infrastructure.workerIssues and PRs related to the worker_threads module and Worker API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions