Jest unit test works locally but fail on circleci docker image cimg/node:16.13

Hi,

What I did so far :

  • I made sure that my circleci config.yml contains the right image version image: cimg/node:16.13
  • I sshd into the circleci container

The error I get is the following

/project/scripts/test.sh: line 3:   634 Killed                  TZ=UTC NODE_ENV=test SYSTEM_UNDER_TEST=client JEST_JUNIT_OUTPUT=reports/junit/junit_client.xml jest --ci --reporters=default --reporters=jest-junit --coverageDirectory=reports/coverage/client --coverage --maxWorkers=2 --logHeapUsage
scripty ERR! script failed: '/project/scripts/test.sh'
scripty ERR! exit status: 137
  • I also run my test locally within a container with image cimg/node:16.13 and I reproduce the same error

I don’t know what to do at this point, what could be different between my local environment and the circleci image container

Basically in circle the unit test are hanging forever and exit eventually with 137

EDIT:
I did 2 test within circleci

  • First test with Jest26 => Test run
  • Second with Jest 27 => Test hang forever

However they both work on my local

I’ve also tried --runInBand and --clearCache does not work