You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we have some little issue with memory leak in test runner.
This causes little problems in our Project. I found a similar bug report #8816 but it's still open.
Thanks a lot for your advices.
Test Suites: 40 passed, 40 total
Tests: 200 passed, 200 total
Snapshots: 0 total
Time: 16.51s
Ran all test suites matching /get.applications/i.
When I run testing with the -detectLeaks parameter, I get an error. Yes, I know this is just an experimental feature, but it will tell you something.
$ npm run test:detectLeaks get.applications1.test
FAIL tests/cases/api/get.applications1.test.ts
● Test suite failed to run
EXPERIMENTAL FEATURE!
Your test suite is leaking memory. Please ensure all references are cleaned.
There is a number of things that can leak memory:
- Async operations that have not finished (e.g. fs.readFile).
- Timers not properly mocked (e.g. setInterval, setTimeout).
- Keeping references to the global scope.
at node_modules/@jest/core/build/TestScheduler.js:257:24
at asyncGeneratorStep (node_modules/@jest/core/build/TestScheduler.js:131:24)
at _next (node_modules/@jest/core/build/TestScheduler.js:151:9)
at node_modules/@jest/core/build/TestScheduler.js:156:7
at node_modules/@jest/core/build/TestScheduler.js:148:12
at onResult (node_modules/@jest/core/build/TestScheduler.js:271:25)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 4.016s
Ran all test suites matching /get.applications1.test/i.
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🐛 Bug Report
Hi everyone,
we have some little issue with memory leak in test runner.
This causes little problems in our Project. I found a similar bug report
#8816 but it's still open.
Thanks a lot for your advices.
When I run testing with the -detectLeaks parameter, I get an error. Yes, I know this is just an experimental feature, but it will tell you something.
To Reproduce
I've created a repository with 40 same test file:
https://github.com/FilipMucka/memory-leak
If you want reproduce first 'PASS' scenario with show heap size run:
and if you want 'FAIL' scenario run:
Expected behaviour
Memory usage for each test will be the same.
Link to repl or repo (highly encouraged)
https://github.com/FilipMucka/memory-leak
envinfo
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Binaries:
Node: 10.16.3 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
jest: 24.9.0 => 24.9.0
The text was updated successfully, but these errors were encountered: