I’m running a project that has several test suites (Jest), all passing locally.
I have a step in my CircleCI job that simply runs yarn test.
The problem is that the entire build hangs during the yarn test step. The tests all pass, but the step just hangs, and times out after 10 min.
To make thing more interesting, if I remove one test suite file from my tests folder, the step will pass. I can remove any tests file, it will still pass. That means there is nothing wrong with my tests. Also, if I remove one file, and add a new file with just one dummy test, the step will hang again.
What am I overlooking? (NOTE: using a free account)
Sure, these steps https://circleci.com/docs/2.0/ssh-access-jobs/ will walk you though how to SSH into the box. I would then suggest running the tests again to see where and how they hang.
I’m seeing the same thing with yarn test and jest v24… It’s really intermittent and sometimes just restarting the build a few times will make it work… Not sure what’s going on either…
For me the problem is very consistent. But I peeked at the github thread you linked, @besquared, and setting -w=2 worked!
Edit for future readers: setting -w=2 limits the number or worker Jest uses to 2. I assume this can be raised to more workers in paid account with stronger machines, but 2 works great for free accounts, which run machines with 2 cores.