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

investigate flaky test-worker-ref-onexit #26167

Closed
Trott opened this issue Feb 17, 2019 · 2 comments
Closed

investigate flaky test-worker-ref-onexit #26167

Trott opened this issue Feb 17, 2019 · 2 comments
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI. test Issues and PRs related to the tests. worker Issues and PRs related to Worker support.

Comments

@Trott
Copy link
Member

Trott commented Feb 17, 2019

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   ...
@Trott Trott added test Issues and PRs related to the tests. flaky-test Issues and PRs related to the tests with unstable failures on the CI. worker Issues and PRs related to Worker support. labels Feb 17, 2019
@addaleax
Copy link
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());

@addaleax
Copy link
Member

addaleax commented Feb 17, 2019

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/

addaleax added a commit to addaleax/node that referenced this issue Feb 17, 2019
addaleax added a commit that referenced this issue Feb 18, 2019
Fixes: #26167

PR-URL: #26170
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
rvagg pushed a commit that referenced this issue Feb 28, 2019
Fixes: #26167

PR-URL: #26170
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI. test Issues and PRs related to the tests. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants