-
Notifications
You must be signed in to change notification settings - Fork 757
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
warning: possible EventEmitter memory leak detected. When user supertest.agent(require(server.js)) #307
Comments
I had a similar issue when setting up supertest from within the World-constructor in Cucumber.js. |
+1 |
3 similar comments
+1 |
+1 |
+1 |
I have the same problem, when using supertest or supertest as promised. |
+1 |
+1 |
+1 |
The Error Message
(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 (/Users/DanHeoFAPL/Desktop/fapl-code/loopback/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/index.js:65:10)
at listen (net.js:1182:10)
at Server.listen (net.js:1267:5)
at Test.serverAddress (/Users/DanHeoFAPL/Desktop/fapl-code/loopback/node_modules/supertest/lib/test.js:56:33)
at new Test (/Users/DanHeoFAPL/Desktop/fapl-code/loopback/node_modules/supertest/lib/test.js:36:12)
at TestAgent.(anonymous function) as post
at /Users/DanHeoFAPL/Desktop/fapl-code/loopback/test/Dan/helpers/pictorials.js:136:9
at /Users/DanHeoFAPL/Desktop/fapl-code/loopback/node_modules/async/lib/async.js:181:20
at Object.async.forEachOf.async.eachOf (/Users/DanHeoFAPL/Desktop/fapl-code/loopback/node_modules/async/lib/async.js:233:13)
Cause
I'm testing Loopback APIs with mocha and supertest.
To start the server, I do
This is what causes the error.
When I have the server listen to a port and use the port to make api calls, this does not cause the problem. Like this:
There are issues open in async-listner github:
othiym23/async-listener#29
But I only get this when using supertest.agent(server) as I mentioned previously...
This always happens when I try to make multiple api calls with async.each.
The text was updated successfully, but these errors were encountered: