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
Bug: Possible memory leak when using real Vuex store in plugins #1787
Comments
@rappjt Thanks for raising this issue. Would you mind pushing your repro to a GitHub repo so someone can take an easy look? |
Can you also try again with |
@cexbrayat - Thank you for the quick response, here is a repo I hope will demonstrate the issue https://github.com/rappjt/vuejs-test-utils-plugin-vuex-memory-issue @freakzlike - Thanks for the suggestion, in my original project I am doing this and still see the issue. I didn't show this in original post as I was trying to make minimal changes to the original test from vue-cli. However, I added |
Describe the bug
I have a project with 8,000+ tests using mocha, many of which create a real Vuex store. Recently we have migrated to Vue3 and test-utils v2. After the upgrade a memory leak is causing the test suite to fail as it runs out of heap space. At this time it seems to be adding a plugin (store) when mounting causes the issue, though not fully sure if there is additional cleanup I must be doing that isn't mentioned in docs.
To Reproduce
I have created the HelloWorld project from vue-cli (webpack, vuex, mocha), and modified the one and only test in that project:
global.plugins
for each testWhen I inspect this while running I can observe each test is leaking memory. Simply, not creating
store
and not pass inplugins
, I no longer see the leak.Expected behavior
Run entire test suite without getting out of heap exception.
Related information:
@vue/test-utils
version: 2.1.0Vue
version: 3.2.39node
version: 14.18.1 and 16.17.1vuex
version 4.0.2@vue/cli-plugin-*
version ~4.5.19Additional context
A few other things I have tested:
config.global.plugins = [store]
, still saw leakstore
but did not actually use inconfig.global.plugins
or inshallowMount
, did not see leakThe text was updated successfully, but these errors were encountered: