async-listener: When required in combination with supertest, causes eventemitter memory leak
Supertest creates and tears down an HTTP request listener per-test, so it’s not uncommon to see something like:
(node) warning: possible EventEmitter memory leak detected. 11 connection listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Server.addListener (events.js:179:15)
at Server._listen2 (~/api/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/index.js:64:10)
at listen (net.js:1155:10)
at Server.listen (net.js:1240:5)
at Test.serverAddress (~/api/node_modules/loopback-testing/node_modules/supertest/lib/test.js:59:33)
at new Test (~/api/node_modules/loopback-testing/node_modules/supertest/lib/test.js:38:12)
at Object.obj.(anonymous function) [as post] (~/api/node_modules/loopback-testing/node_modules/supertest/index.js:25:14)
at Context.<anonymous> (~/api/node_modules/loopback-testing/lib/helpers.js:243:46)
at Hook.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:217:15)
at next (/usr/local/lib/node_modules/mocha/lib/runner.js:258:10)
at Immediate.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runner.js:275:5)
at Immediate._onImmediate (~/api/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31)
at processImmediate [as _immediateCallback] (timers.js:358:17)
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.
About this issue
- Original URL
- State: open
- Created 9 years ago
- Reactions: 1
- Comments: 15 (2 by maintainers)
Same here with a loopback app