Tests are running much slower in 7.0.0-alpha.1 with --no-cache
See original GitHub issueMy setup: babel-preset-env: 1.7.0, jest: 23.6.0, jest-preset-angular: 7.0.0-alpha.1, jest-sonar-reporter: 2.0.0,
I am using babel-jest to process *.js
files.
I am trying to upgrade from 6.0.0 -> 7.0.0-alpha.1. I am running jest with:
npm run jest -- --no-cache
and observing that the time required to finish tests goes up from ~120s to around 950s. When i enable the cache, then the first run is slow, but consecutive run is much faster (same as in version 6.0.0) - around 30s.
Anyone else experiencing same behavior? What could be the cause for this, where should i look?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
javascript - Jest - Simple tests are slow - Stack Overflow
Another possibility is that ts-jest is slow. There was an issue about that, and it was not completely resolved. There are various workarounds...
Read more >Caching is very slow for Node.JS projects - gitlab-runner
Ideally in this scenario the runner would just unpack the cache created by the previous build job within the test jobs and completely...
Read more >Diagnosing a single slow test - Jon Skeet's coding blog
I have near-identical hardware to run tests on: gabriel is running Linux; bagpuss is running Windows. Under a release build, the test takes...
Read more >Setting up super fast Cypress tests on GitHub Actions - PostHog
Enter Cypress. According to Cypress's GitHub repo it is a fast, easy and reliable testing for anything that runs in a browser. What...
Read more >Test run slow when running with `--test com.example.FooTest`
When running tests using --tests, gradle seems to initialize other tests (although it does not run them) this significantly adds to test run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI, this might be one of the causes of performance
@wtho @thymikee thanks. I have tested with alpha.2 and it is a bit faster. I’m currently at ~500s with
--no-cache
and 300s on the first run after--clearCache
. I’ve put log into create visitor function and it is called multiple times for some.ts
files, it depends on the situation. Jest spawns 7 threads on my machine to run the tests and each of that thread transforms.ts
and.js
files on its own, so some of the files are transformed multiple times, up to 7 times. I understand now why each of my file in library is transformed 7 times when i change the mapping fromdist
tosrc
. It is because when i tell jest to usedist
folder it doesn’t need to transform my library as it is already compiled to.js
. When i ran my tests withsrc
then i got 7 hits increateVisitor
for my library’sindex.ts
files which in turn transforms 7 times every exported library file.I will write a question to
ts-jest
directly asjest-preset-angular
just uses that and it seems that theastTransformer
is quite fast.