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:
- Create jest tests
- Create Github workflow to test on Node.js 12.x
- 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
- Disable testing on Node.js 12 temporarily. Ref: https://github.com/facebook/jest/issues/10662 — committed to Ionaru/typeorm-utils by Ionaru 4 years ago
- Try a different maxWorkers setting Should still dodge the weird GH issue tracked by https://github.com/facebook/jest/issues/10662 but won't impact local machine runs as much — committed to IronCoreLabs/recrypt-node-binding by skeet70 3 years ago
- Neon packaging (#75) Removed the native directory. Made the tests run expecting the same structure as what we distribute. That same structure is created by either running `yarn compile` or `node-pr... — committed to IronCoreLabs/recrypt-node-binding by skeet70 3 years ago
- Upgrade dependencies (#74) * Update to latest of all deps * Recrypt 0.12 * Try Node 16 as well * Reduce cardinality * Bump MSRV to 1.51 * Update documentation. * Upgrade JS dependen... — committed to IronCoreLabs/recrypt-node-binding by giarc3 3 years ago
- fix: disable jest coverage to test seg fault Refs: https://github.com/facebook/jest/issues/10662#issuecomment-870700903 — committed to trivikr/aws-sdk-js-v3 by trivikr 2 years ago
- fix(ui-test): segmentation fault error unit tests Getting segmentation fault error on GitHub CI too frequently for running tests with coverage. trying possible fix for it Reference: https://github.... — committed to open-metadata/OpenMetadata by chirag-madlani 2 years ago
- fix(ui-test): segmentation fault error unit tests (#7840) * fix(ui-test): segmentation fault error unit tests Getting segmentation fault error on GitHub CI too frequently for running tests with co... — committed to open-metadata/OpenMetadata by chirag-madlani 2 years ago
- fix(ui-test): segmentation fault error unit tests (#7840) * fix(ui-test): segmentation fault error unit tests Getting segmentation fault error on GitHub CI too frequently for running tests with cove... — committed to open-metadata/OpenMetadata by chirag-madlani 2 years ago
- Release 0.12.3 - Updated the required files (#8879) * Release 0.12.3 - Updated the required files * updated Docker File * fix(ui-test): segmentation fault error unit tests (#7840) * fix(ui-t... — committed to open-metadata/OpenMetadata by mohityadav766 2 years ago
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 backisomorphic-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
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 dependenciesAlso getting
Segmentation fault (core dumped)
3 times in 3 days, it was extremely rare before. https://github.com/prisma/prisma/runs/3021367125#step:9:247Probably the latest Node.js 12.x version got a glitch?