jestjs/jest

Automatically determine better value for --maxWorkers for Travis CI

nodkz opened this issue ยท 2 comments

nodkz commented

Do you want to request a feature or report a bug?
feature

What is the current behavior?
Jest spawns unknown huge amount of workers on Travis CI. And if you make tests for several node versions it multiplies by its number. If you use DB or something other resources it may bring race conditions and fail tests.

After tuning Travis CI config all starts working like a charm. It very simple to tune, but it was a huge pain to determine the problem and find a solution.

# .travis.yml

script:
-  - yarn run coverage
+  - yarn run coverage -- --maxWorkers 4

Also maybe used unrecommended --runInBand.

What is the expected behavior?
Painless testing for all. ๐Ÿ˜Š

Last success test with --maxWorkers 4 option. Two days of pain ๐Ÿ˜…
https://travis-ci.org/nodkz/graphql-compose-mongoose/builds
screen shot 2017-06-08 at 17 11 31

We generally advice running jest on Ci without spawning extra workers using jest --runInBand to avoid such problems.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.