Version
Node >=v19
Steps to reproduce
- Clone
enisdenjo/jest-fetch-leak repo
- Read its readme for local repro
- Check out the GitHub Actions for CI repo
Expected behavior
Doesn't leak ever.
Actual behavior
Leaks in Node >=v19 when test is repeated enough times.
Additional context
⚠️ Not really sure whether this issue belongs here or on Jest's repo. But, I have a hunch that it belongs here given that we're experiencing memory spikes with Node >=v19 in production. Nevertheless, I've opened an issue there too.
If a test, which uses native fetch, is iterated enough times in Node >=v19, Jest's --detectLeaks will report a memory leak.
This behaviour does not happen on Node <=v18.
Please check the leak detector tests in the CI.
Environment
ubuntu-latest from GitHub Actions
Version
Node >=v19
Steps to reproduce
enisdenjo/jest-fetch-leakrepoExpected behavior
Doesn't leak ever.
Actual behavior
Leaks in Node >=v19 when test is repeated enough times.
Additional context
If a test, which uses native
fetch, is iterated enough times in Node >=v19, Jest's--detectLeakswill report a memory leak.This behaviour does not happen on Node <=v18.
Please check the leak detector tests in the CI.
Environment