aegir
aegir copied to clipboard
Coverage in aegir + node hangs on CI and Local Dev
Describe the bug
We had to disable code coverage in node 18, which pushed the burden of checking code coverage onto maintainers and PR reviewers.
@achingbrain has prepared a PR to enable it back, but it's still blocking: https://github.com/ipfs/aegir/pull/1195
Examples: https://github.com/ipfs/aegir/actions/runs/4225847659/jobs/7338650113
@BigLep shared details on why we need to solve this in https://filecoinproject.slack.com/archives/C03KLC57LKB/p1678122004165499
Options:
- Figure out what happens and fix it,
- Use a different code coverage tool that doesn't have the same issue.
- NYC might be abandoned: https://github.com/istanbuljs/nyc/issues/1514
Issue was created in https://github.com/bcoe/c8/issues/454
There is a nodejs related issue discussed in https://github.com/bcoe/c8/issues/432, which leads to https://github.com/nodejs/node/issues/45013 and https://github.com/nodejs/node/pull/45055.
Naively, I tried to run the test on many different version, hoping I would find a clear "v18 is broken" or something. But, if you exclude the "missing fetch function" on older nodejs versions, it seems that every version hangs, except the node v19 on windows: https://github.com/laurentsenta/aegir/actions/runs/4353486483/jobs/7607591085
According to this comment (https://github.com/bcoe/c8/issues/432#issuecomment-1576944588), folks are able to fix the issue by moving to node v20.
I've updated the PR that re-enables coverage to only run coverage on node 20 but it still hangs so I think that comment is a red herring.
Edit: Actually looking at that issue they're reporting a segfault which is not the problem we are seeing. The problem we see is detailed above - the process hangs after the test run finishes, it doesn't crash.
Possibly related: https://github.com/nodejs/node/issues/49344