Attempting to replicate an issue I have seen in a larger project (8,000+ tests) that runs out of heap memory during full test suite run.
See this vuejs/test-tils issue for more details.
This project was created from from vue-cli v4 (webpack, vuex, mocha). I have modified the one and only test in that project to attempt to demonstrate the issue:
- Looped single test many times
- Created a store and added to
global.plugins
for each test.- I used this exmaple to create/add the store.
- Added
unmount
at the end of each test
I am testing by running npm run unitI
then inspecting with chrome devtools. I observe that
- The togal JS heap size continues to grow
- When looking at Allocation instrumentation on timeline, each test seems to leak memory
When I run the original test (no store, no plugins) I do not see this memory leak.
Currently running with
- node v14.18.1
- npm 6.14.15
npm install
npm run serve
npm run build
npm run unit
Run with --inspect-brk and long timeout to accommodate profiling overhead
npm run unitI
npm run lint