Skip to content

Investigate flaky async-hooks.test-improper-unwind #58463

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

Closed
RaisinTen opened this issue May 26, 2025 · 6 comments
Closed

Investigate flaky async-hooks.test-improper-unwind #58463

RaisinTen opened this issue May 26, 2025 · 6 comments
Labels
aix Issues and PRs related to the AIX platform. async_hooks Issues and PRs related to the async hooks subsystem. child_process Issues and PRs related to the child_process subsystem. flaky-test Issues and PRs related to the tests with unstable failures on the CI.

Comments

@RaisinTen
Copy link
Member

Test

test/async-hooks/test-improper-unwind.js

Platform

AIX

Console output

---
duration_ms: 362.309
exitcode: 1
severity: fail
stack: |-
  node:assert:94
    throw new AssertionError(obj);
    ^

  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

  null !== 1

      at ChildProcess.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/async-hooks/test-improper-unwind.js:59:12)
      at ChildProcess.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/common/index.js:437:15)
      at ChildProcess.emit (node:events:507:28)
      at maybeClose (node:internal/child_process:1101:16)
      at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: null,
    expected: 1,
    operator: 'strictEqual'
  }

  Node.js v25.0.0-pre
...

Build links

Additional information

No response

@RaisinTen RaisinTen added the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label May 26, 2025
@github-actions github-actions bot added the aix Issues and PRs related to the AIX platform. label May 26, 2025
@RaisinTen
Copy link
Member Author

cc @nodejs/async_hooks

@Flarna
Copy link
Member

Flarna commented May 27, 2025

This doesn't look like it is related to async hooks.
A child process is spawned but the close event of child process doesn't provide the exit code.
Could be also some issue in child process on aix or some temp resource limitation that child process couldn't be started. properly.

@Flarna Flarna added child_process Issues and PRs related to the child_process subsystem. async_hooks Issues and PRs related to the async hooks subsystem. labels May 27, 2025
@RaisinTen
Copy link
Member Author

The child_process implementation in

this.signalCode = null;
this.exitCode = null;
this.killed = false;
this.spawnfile = null;
this._handle = new Process();
this._handle[owner_symbol] = this;
this._handle.onexit = (exitCode, signalCode) => {
if (signalCode) {
this.signalCode = signalCode;
} else {
this.exitCode = exitCode;
}
shows that initially the signalCode and exitCode properties on the child process object are both set to null.

On exit:

  • if signalCode is truthy
    • just the signalCode property is set with the new value
    • and the exitCode property remains null
  • otherwise
    • just the exitCode property is set with the new value
    • and the signalCode property remains null

The child process is getting killed with a signal, that's why the 'close' callback is called with a null code and a truthy signal (we don't know what value this holds because it's not being logged). I think the test should log the signal and continue the assertions for now.

RaisinTen added a commit to RaisinTen/node that referenced this issue May 27, 2025
When the spawned child process gets closed with a signal, the exit code
is not set and that is why the exit code assertion was failing. This
change adjusts the test to check the signal and if it is truthy, it
doesn't assert the exit code and instead logs the signal and continues
the rest of the assertions.

Refs: nodejs#58463 (comment)
Refs: nodejs#58199
Refs: nodejs#58463
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@RaisinTen
Copy link
Member Author

Submitted a PR: #58478

RaisinTen added a commit to RaisinTen/node that referenced this issue May 27, 2025
@RaisinTen
Copy link
Member Author

I have also created a PR to update the child process docs with this info - #58479

nodejs-github-bot pushed a commit that referenced this issue May 29, 2025
When the spawned child process gets closed with a signal, the exit code
is not set and that is why the exit code assertion was failing. This
change adjusts the test to check the signal and if it is truthy, it
doesn't assert the exit code and instead logs the signal and continues
the rest of the assertions.

Refs: #58463 (comment)
Refs: #58199
Refs: #58463
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #58478
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
nodejs-github-bot pushed a commit that referenced this issue May 29, 2025
Refs: #58463 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #58479
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this issue May 31, 2025
When the spawned child process gets closed with a signal, the exit code
is not set and that is why the exit code assertion was failing. This
change adjusts the test to check the signal and if it is truthy, it
doesn't assert the exit code and instead logs the signal and continues
the rest of the assertions.

Refs: #58463 (comment)
Refs: #58199
Refs: #58463
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #58478
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this issue May 31, 2025
Refs: #58463 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #58479
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@RaisinTen
Copy link
Member Author

I can confirm that #58478 has fixed this issue.

This flake was appearing in the reliability report 2-4 times daily from 2025-05-23 - nodejs/reliability#1209 till 2025-06-01 nodejs/reliability#1218. The PR landed on 2025-05-29 and after the PRs where CI was being run on included this change, the flake went away in all recent reliability reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aix Issues and PRs related to the AIX platform. async_hooks Issues and PRs related to the async hooks subsystem. child_process Issues and PRs related to the child_process subsystem. flaky-test Issues and PRs related to the tests with unstable failures on the CI.
Projects
None yet
Development

No branches or pull requests

2 participants