-
Notifications
You must be signed in to change notification settings - Fork 52
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
When required in combination with supertest, causes eventemitter memory leak #29
Comments
Interesting, the one thing I notice is the on('connection') that gets added to _listen2 should probably be changed to a once. That would probably fix this issue, it might be better to just make sure the listener was not already added before doing on. But I can definitely see how shutting down and reconnecting a a server could cause this issue. Its a pretty strange pattern, so not too surprising no one has run into this before |
Yeah it is a bit strange. I don't think you'd see it much in production though, just test, so not the highest of priorities but it is a bit annoying. |
In any case should this code even be running in Node 0.12? |
I have been having the same issue. It only happens if I use supertest(require('app')) but not when I connect to an already running app on a specified url using supertest('http://localhost:1234'). |
Hey guys, is there any update on this issue? We're having a fairly big test suite and with this leak our tests just die in the middle of execution after a few thousand (≈ 4000) https calls through |
I'm running into same issue here. |
Same here with a loopback app |
Same as @DaGaMs |
any updates? 👀 still an issue in 2021 👎 |
Any no update or workaround about this issue? |
This hasn't been maintained for years. Why are you still using it when the functionality has been in Node.js core for several years now? 🤔 |
The feature in Node core mentioned above: https://nodejs.org/api/async_context.html. |
@Qard I am using supertest, and there were some memory leaks, I was here because there was an open issue on superagent which was related to this one. |
Supertest doesn't use async-listener. Somewhere else in your dependency graph something is still using this module when it shouldn't. |
Supertest creates and tears down an HTTP request listener per-test, so it's not uncommon to see something like:
Perhaps this should be tearing down on 'close'?
In any case, should this even be running in Node 0.12? I thought it was just a polyfill for something that was going to ship in core.
The text was updated successfully, but these errors were encountered: