Skip to content
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

Tests are much slower since 22 #892

Open
trollepierre opened this issue Aug 2, 2018 · 14 comments
Open

Tests are much slower since 22 #892

trollepierre opened this issue Aug 2, 2018 · 14 comments
Labels

Comments

@trollepierre
Copy link
Contributor

trollepierre commented Aug 2, 2018

Version

1.0.0-beta.22

Steps to reproduce

VueTestUtils + Jest + snapsnots are slower since beta 22

What is expected?

My tests use to last 70 seconds (900 tests, 70 snapshots) during VTU beta 20.

What is actually happening?

Now they last 170 seconds (900 tests, 70 snapshots) during VTU beta 22


I don't know why it is so slow, but I believe this should be fastened

@trollepierre trollepierre changed the title Tests are much slower Tests are much slower since 22 Aug 2, 2018
@eddyerburgh
Copy link
Member

Yes we should make sure tests are as fast as possible.

Are you able to provide me a repo that demonstrates the slower tests? That way I can investigate perf improvements.

@trollepierre
Copy link
Contributor Author

Sorry I am not allowed.
Maybe I will create a personal project to help.

@trollepierre
Copy link
Contributor Author

We have inconsistence when passing tests. (some simple tests needs 8seconds)
Sometimes all tests on our pipeline lasts more than 1 hour
Sometimes all tests on our pipeline lasts 170-250 seconds...
I don't know what happen but I think we will go back to beta 20.

@trollepierre
Copy link
Contributor Author

This is one test that lasts 8 min on our pipeline https://codesandbox.io/s/308vv8l08p

@trollepierre
Copy link
Contributor Author

Long tests are fixed in beta 24. I don't know why. Thanks for that.
But I stil have test times that is multiplied by 2. I will investigate

@trollepierre
Copy link
Contributor Author

trollepierre commented Aug 8, 2018

After investigation, I notice that Jest RAM consumption has exploded from beta 20 to beta 24.
That provokes long tests, timeout on my Docker, ...
Having a repository with 1000 tests (mixing mount and shallowMount) will be enough to have a good repro (I did it)

@trollepierre
Copy link
Contributor Author

On that branch,
https://github.com/trollepierre/recontact_travel_blog/tree/vue-test-utils-perf

Tests last 18 seconds on vue-test-utils@^beta 20 and 32 seconds on vue-test-utils@^beta 24

The issue is on that component:
https://github.com/trollepierre/recontact_travel_blog/blob/vue-test-utils-perf/client/src/components/DTP/DatetimePicker.spec.js
(I intentionally duplicate tests for this issue)

@eddyerburgh
Copy link
Member

Thanks for the reproduction.

I'm failing to replicate your results on my machine, I actually get a shorter time on beta.24 (~10s) compared to beta.20 (~13s).

I've been profiling the vue-test-utils tests and can't see any obvious expensive function calls. I'll keep investigating, because it's important that Vue Test Utils is fast.

@trollepierre
Copy link
Contributor Author

Could you limit your RAM use to 2 Go?

We notice a memory leak when executing the tests. Because we can see the RAM consumption increasing on EACH of the Jest process as long as tests are executed.

@trollepierre
Copy link
Contributor Author

Are you using the good branch? the branch vue-test-utils-perf?
On my Mac with 16 Go of RAM, it's 32seconds.

The time of 10 seconds is close to my time without the thousands of duplicated tests...

@eddyerburgh
Copy link
Member

Thanks, I switched branches and profiled. The functions that are taking the longest are internal calls to createLocalVue, and external calls to Vue.use.

I'm going to open a PR to minimize internal createLocalVue calls. I'll continue investigating and improving performance.

@mkopinsky
Copy link

I don't know if it's related to this, but when running tests with mocha-webpack --watch, we occasionally see tests slow to a crawl, and node sometimes dies entirely with a stack trace/core dump. This points (in my mind) to a memory leak somewhere, but I have no clue if it's in mocha, mocha-webpack, vue-test-utils, or elsewhere.

I'd be happy to post the stack trace or do some other investigation next time this happens - if you have any debugging/profiling recommendations, I would be appreciative!

@BrianBrenner
Copy link

I haven't been noticing tests slowing down, but I only have 300 tests so it might not be noticiable yet, but lately the node heap has been running out of memory. I'm running the tests with using Karma and mocha and this plugin for Vue CLI 3 (https://www.npmjs.com/package/vue-cli-plugin-unit-karma). When running with the watch flag the heap runs out of memory after running two or three times.

@trollepierre
Copy link
Contributor Author

trollepierre commented Nov 28, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants