aegir icon indicating copy to clipboard operation
aegir copied to clipboard

Coverage in aegir + node hangs on CI and Local Dev

Open laurentsenta opened this issue 2 years ago • 4 comments

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

laurentsenta avatar Mar 07 '23 14:03 laurentsenta

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

laurentsenta avatar Mar 07 '23 14:03 laurentsenta

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.

ronald-mz avatar Jun 09 '23 15:06 ronald-mz

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.

achingbrain avatar Jun 10 '23 07:06 achingbrain

Possibly related: https://github.com/nodejs/node/issues/49344

achingbrain avatar Oct 25 '23 15:10 achingbrain