jest: Segmentation fault (core dumped) on Github Actions running Node.js 12.x

πŸ› Bug Report

Running tests on Github Actions using Node.js 12.x gives a segmentation fault very frequently when the tests are done.

To Reproduce

Steps to reproduce the behavior:

  1. Create jest tests
  2. Create Github workflow to test on Node.js 12.x
  3. Run the workflow

Expected behavior

The tests succeed (or fail) normally.

Link to repl or repo (highly encouraged)

https://github.com/Ionaru/typeorm-utils/runs/1281969729?check_suite_focus=true

envinfo

  System:
    OS: Linux 5.4 Ubuntu 18.04.5 LTS (Bionic Beaver)
    CPU: (2) x64 Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
  Binaries:
    Node: 12.19.0 - /opt/hostedtoolcache/node/12.19.0/x64/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.8 - /opt/hostedtoolcache/node/12.19.0/x64/bin/npm
  npmPackages:
    jest: ^26.6.0 => 26.6.0 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 25
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I just solved the problem by setting maxWorkers to 3.

I have a guess experimental-vm-modules flag spends one more available worker and jest-worker must use os.CPUS - 2 or something like this.

cc @SimenB

So this is going to sound super weird, but for me the problem started occurring when I upgraded isomorphic-unfetch to v4+. I’ve been having this segfault problem for about 2 weeks, and eventually tracked back the first occurrence to the Dependabot PR updating isomorphic-unfetch in my project. I tried rolling back isomorphic-unfetch to v3.1.0, and Jest no longer throws a segfault. I have no clue why that would be the problem though.

As noted in the Bug Report template, all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example.

in my case, not related to node 12, removing --detectOpenHandles helped

reference: https://stackoverflow.com/questions/68012814/gitlab-jest-test-segmentation-fault-core-dumped

v3.1.0,

this solved for me, thanks

Haivng this issue as well running tests on the node:16-alpine container – the tests were working fine previously, and now the same tests fail during the setup phase. They run fine locally with the same configuration. Same issue with node 18, and we can’t go below 16 with our dependencies

Also getting Segmentation fault (core dumped) 3 times in 3 days, it was extremely rare before. https://github.com/prisma/prisma/runs/3021367125#step:9:247

Probably the latest Node.js 12.x version got a glitch?