🐛 Bug Report
When using jest-circus, an obvious memory leak and gradual slowdown occurs.
$ node --expose-gc ./node_modules/.bin/jest --logHeapUsage --runInBand funky
PASS tests/funky-36.test.js (20 MB heap size)
PASS tests/funky-86.test.js (22 MB heap size)
PASS tests/funky-28.test.js (24 MB heap size)
...
PASS tests/funky-56.test.js (195 MB heap size)
PASS tests/funky-24.test.js (197 MB heap size)
PASS tests/funky-30.test.js (199 MB heap size)
PASS tests/funky-52.test.js (201 MB heap size)
To Reproduce
100 identical tests with jest-circus/runner.
describe('funky-10.test', () => {
test('funky-10', async () => {
expect(1).toEqual(1);
});
});
jest.config:
testRunner: require.resolve('jest-circus/runner')
Expected behavior
Same 100 tests without jest-circus/runner.
$ node --expose-gc ./node_modules/.bin/jest --logHeapUsage --runInBand funky
PASS tests/funky-36.test.js (17 MB heap size)
PASS tests/funky-40.test.js (17 MB heap size)
PASS tests/funky-28.test.js (17 MB heap size)
...
PASS tests/funky-18.test.js (17 MB heap size)
PASS tests/funky-87.test.js (17 MB heap size)
PASS tests/funky-89.test.js (17 MB heap size)
Link to repl or repo (highly encouraged)
https://github.com/dylang/jest-circus-memory-leak-repo
Run npx envinfo --preset jest
System:
OS: macOS Sierra 10.12.6
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
Node: 10.8.0 - ~/.nvm/versions/node/v10.8.0/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.8.0/bin/npm
npmPackages:
jest: ^23.6.0 => 23.6.0
🐛 Bug Report
When using
jest-circus, an obvious memory leak and gradual slowdown occurs.To Reproduce
100 identical tests with
jest-circus/runner.jest.config:Expected behavior
Same 100 tests without
jest-circus/runner.Link to repl or repo (highly encouraged)
https://github.com/dylang/jest-circus-memory-leak-repo
Run
npx envinfo --preset jestSystem: OS: macOS Sierra 10.12.6 CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz Binaries: Node: 10.8.0 - ~/.nvm/versions/node/v10.8.0/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.8.0/bin/npm npmPackages: jest: ^23.6.0 => 23.6.0