Skip to content

async-hooks.test-emit-after-on-destroyed is flaky #50245

Description

@anonrig

Test

async-hooks.test-emit-after-on-destroyed

Platform

Other

Console output

not ok 32 async-hooks/test-emit-after-on-destroyed
  ---
  duration_ms: 403.10800
  severity: fail
  exitcode: 1
  stack: |-
    node:assert:125
      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-emit-after-on-destroyed.js:56:12)
        at ChildProcess.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/common/index.js:476:15)
        at ChildProcess.emit (node:events:515:28)
        at maybeClose (node:internal/child_process:1105:16)
        at Socket.<anonymous> (node:internal/child_process:457:11)
        at Socket.emit (node:events:515:28)
        at Pipe.<anonymous> (node:net:337:12) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: null,
      expected: 1,
      operator: 'strictEqual'
    }
    
    Node.js v21.0.0
  ...

Build links

Additional information

No response

Activity

added
flaky-testIssues and PRs involving tests that fail intermittently in CI.
on Oct 18, 2023

Flarna commented on Oct 18, 2023

@Flarna
Member

Seems to be a child process issue not async hooks.
The assert checks the exit code given via the childprocess close event which is a number according to docs but here it is null.

richardlau commented on Oct 18, 2023

@richardlau
Member

Seems to be a child process issue not async hooks. The assert checks the exit code given via the childprocess close event which is a number according to docs but here it is null.

Usually the exit code being null means that the child was ended by a signal.

anonrig commented on Oct 18, 2023

@anonrig
MemberAuthor

Similar test is flaky as well: #50262

abmusse commented on Jan 29, 2024

@abmusse
Contributor

I started to investigate this issue last week.

I asked @mhdawson to spin up some stress tests

ref: https://ci.nodejs.org/job/node-stress-single-test/nodes=rhel8-ppc64le/469/console

We ran this test case 1000 times on rhel8 ppc64le. This did not reproduce the error though.

I then built Node.js 21.0.0 (The version of node at the time of the issue) on my local machine (Fedora 39). From there I ran this test 100k times and I still was not able to reproduce a test failure.

$ tools/test.py -j 16 --repeat=100000 async-hooks/test-emit-after-on-destroyed
[14:17|% 100|+ 100000|-   0]: Done                               

All tests passed.

As noted before in #50245 (comment), the failure occurs due to a signal be raised but will need find a way to reproduce the failure to get more info on the signal and why the test case is getting signaled.

@mhdawson

Any further suggestions on how to reproduce the error?

Maybe it occurs more when running all the test cases together?

OR

Maybe it presents itself more frequently on some platforms? The original issue indicates it occurred on ppc64 AIX. Maybe stress testing AIX would reproduce the error.

mhdawson commented on Jan 29, 2024

@mhdawson
Member

@abmusse I think trying the stress test on one of the platforms where we saw the failure makes sense. I think that @richardlau mentioned you still have access to one of the AIX machines from an earlier investigation so trying the 100k run there would be a good next step.

abmusse commented on Feb 2, 2024

@abmusse
Contributor

@mhdawson

Today I ran 100k stress test on one our AIX machines.

$ tools/test.py --repeat=100000 async-hooks/test-emit-after-on-destroyed
[59:37|% 100|+ 100000|-   0]: Done   

Running it 100k times on AIX didn't reproduce the error.

abmusse commented on Mar 5, 2024

@abmusse
Contributor

I suggest we un-mark this test as flaky as running it 100k times did not reproduce the error.

I will keep an eye on it and if it returns to a flaky state will handle marking it as flaky again.

2 remaining items

sxa commented on Jan 14, 2026

@sxa
Member

Re-opening this as I've seen it failing in CI and a stress run on showed 79/1000 failures in this test. Exclude PR created at #61381

@abmusse ref your earlier comment about it not failing for you on 100 attempts on "our AIX machines" did you mean ones in the Node.js infrastructure or others that you have access to?

reopened this on Jan 14, 2026

github-actions commented on Jul 20, 2026

@github-actions
Contributor

This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

added
staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jul 20, 2026

avivkeller commented on Aug 9, 2026

@avivkeller
Member

This issue slipped through the cracks because our previous stale bot only tracked issues and couldn't catch all the issues.
Our new stale bot flagged this, and would have closed it shortly after RenderATL, but I'm just doing it a bit early so
maintainer's can focus on new code-and-learn PRs during the event.

If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.

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.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions