-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest much slower in Travis CI than locally #7647
Comments
This is using Jest 24 beta btw. |
Have you tried limiting workers? |
With 4 workers its still 190.84s but it seemed to crash in Node 11. https://travis-ci.org/milesj/boost/jobs/481648087 Gonna try 2 workers. With Not sure either of those help me right now. |
Unless you're paying, |
Can you try to remove |
Turned off I also noticed a ton of
|
Running not in a child process is the same speed. |
@milesj are you using the jsdom env? I'm thinking this may be the cause |
@mattfysh Good call, that slipped my mind. Since I haven't defined it, it's defaulting to jsdom. I'll try it without. |
Using node env crashed Travis. Using node env + 2 workers took about 282.66s. Still seems rather slow. This is weird. |
Any other diagnostics I could run to try and debug this? Tests taking 764.268s now. https://travis-ci.org/milesj/boost/jobs/484611089 Possible memory leak or something else? |
Hmm, maybe. Would you be able to reduce it down to something that's slow locally as well? Make sure to pass the |
You can run with |
Trying that, will report back. In the mean time, I've been going through my CI builds and this commit seemed to double the time it takes. But nothing seems out of the ordinary. This is slightly around when I started using Jest 24 alpha, but not sure if that's a red herring or not. Also this one, which changes the istanbul comments. But that also seems like a stretch. |
Memory leak stuff seems to be spurious. Not entirely useful. https://travis-ci.org/milesj/boost/jobs/484960305 It's failing on the most basic of tests: https://github.com/milesj/boost/blob/master/packages/core/tests/i18n/LanguageDetector.test.ts / https://github.com/milesj/boost/blob/master/packages/core/src/i18n/LanguageDetector.ts |
Can you reproduce the error/slowness in a smaller repo? There's so much stuff code there, it's hard to tell what's going on. Potentially, just a branch in the same repo which deletes most of the code but still shows it being slow |
Yeah I'll try and narrow it down if I can. |
I wonder if this is also relevant: #7732 |
Then it should be slow locally as well. Might very well be the reason, of course - if you have a bajillion files, the relatively weak CPU of travis will be slow 🙂 Shouldn't be that slow though |
I've noticed that imports to
Going through execa now. Maybe the leak there is causing issues. |
Found some timers that weren't faked and it brought it down to 370s. Also fixed the open handle issue. https://github.com/milesj/boost/pull/32/files Think this is as good as it'll get for now. |
Gonna close this. |
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. |
🐛 Bug Report
When running Jest locally, all tests finish in 12 seconds. When running in Travis CI, they finish in 448 seconds. Here's the local output:
And the CI output.
Notice in the CI that
BoostReporter.test.ts
takes 161.036s,NyanReporter.test.ts
takes 170.847s, andConsole.test.ts
takes 90.95s, while the local testing does not even hit the slow timing threshold. The heap usage is relatively the same between both.The one common denominator between the reporters is that they use chalk and have many tests that compare chalk output. For example:
However, I've tried disabling chalk using
chalk.enabled = false
, but the timings did not change.Another possible culprit is the console mocking that I do here:
But still at a loss at why that would cause these issues.
To Reproduce
Steps to reproduce the behavior:
yarn install
yarn run setup
yarn run jest
Expected behavior
CI tests not to be so slow.
Link to repl or repo (highly encouraged)
Example CI builds can be found here: https://travis-ci.org/milesj/boost/builds/481201444
Run
npx envinfo --preset jest
Local:
CI:
The text was updated successfully, but these errors were encountered: