Running my Jest test suite on CircleCI is much slower compared to locally, resulting in an error in CircleCI saying npm test died unexpectedly
.
To give you an idea of the difference in test duration on CircleCI vs. Locally (on a MacBook Air 2012, fwiw):
CircleCI:
97 tests passed (97 total in 25 test suites, run time 123.918s)
npm test died unexpectedly
Locally:
97 tests passed (97 total in 25 test suites, run time 13.601s)
The only semi-related piece of information I've found related to Jest and CircleCI is this issue regarding controlling memory usage, however I don't think the issue I'm experiencing is related, but then again if I knew the issue I wouldn't be here :)
Any ideas what might be going on here, or tips to debug?
Thanks to @cpojer in the #jest channel, I was able to reduce the test runtime down to ~21s by running my tests with --runInBand
, which:
Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With