Skip to content
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

EventEmitter leak #117

Closed
tj opened this issue Dec 4, 2011 · 10 comments
Closed

EventEmitter leak #117

tj opened this issue Dec 4, 2011 · 10 comments
Labels
type: bug a defect, confirmed by a maintainer

Comments

@tj
Copy link
Contributor

tj commented Dec 4, 2011


  ..........(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
    at Hook.<anonymous> (events.js:133:17)
    at next (/Users/tj/projects/express-resource/node_modules/mocha/lib/runner.js:157:10)
    at Array.0 (/Users/tj/projects/express-resource/node_modules/mocha/lib/runner.js:169:5)
    at EventEmitter._tickCallback (node.js:192:40)
.....

due to the hook error event. we exit currently anyway so it's not a big deal but the warning is annoying

@tj tj closed this as completed in e673963 Dec 4, 2011
@sudhirj
Copy link

sudhirj commented Apr 20, 2012

I'm using the latest version 1.0.1, on node 0.6.8 and getting the same problem:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
at EventEmitter. (events.js:139:15)
at EventEmitter. (node.js:383:29)
at Runner.run (/Users/sudhirjonathan/projects/liz/node_modules/mocha/lib/runner.js:426:11)
at run (/Users/sudhirjonathan/projects/liz/node_modules/mocha/bin/_mocha:277:10)
at /Users/sudhirjonathan/projects/liz/node_modules/mocha/bin/_mocha:222:7
at /Users/sudhirjonathan/projects/liz/node_modules/mocha/bin/_mocha:263:18
at Array.forEach (native)
at load (/Users/sudhirjonathan/projects/liz/node_modules/mocha/bin/_mocha:258:9)
at loadAndRun (/Users/sudhirjonathan/projects/liz/node_modules/mocha/bin/_mocha:221:5)
at /Users/sudhirjonathan/projects/liz/node_modules/mocha/bin/_mocha:241:5
at StatWatcher. (/Users/sudhirjonathan/projects/liz/node_modules/mocha/lib/utils.js:140:36)
at StatWatcher.emit (events.js:70:17)
at StatWatcher.onchange (fs.js:705:10)

@bwghughes
Copy link

Me too - I'm running:

mocha --compilers coffee:coffee-script -w -G

"mocha": "~1.0.1",
"chai": "~0.5.3",
"node-dev": "~0.2.2"

The stack trace I get is:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
at EventEmitter. (events.js:139:15)
at EventEmitter. (node.js:389:29)
at Runner.run (/usr/local/lib/node_modules/mocha/lib/runner.js:426:11)
at run (/usr/local/lib/node_modules/mocha/bin/_mocha:277:10)
at /usr/local/lib/node_modules/mocha/bin/_mocha:222:7
at /usr/local/lib/node_modules/mocha/bin/_mocha:263:18
at Array.forEach (native)
at load (/usr/local/lib/node_modules/mocha/bin/_mocha:258:9)
at loadAndRun (/usr/local/lib/node_modules/mocha/bin/_mocha:221:5)
at /usr/local/lib/node_modules/mocha/bin/_mocha:241:5
at StatWatcher. (/usr/local/lib/node_modules/mocha/lib/utils.js:140:36)
at StatWatcher.emit (events.js:70:17)
at StatWatcher.onchange (fs.js:705:10)

I wonder if this is a node_dev thing - does the restart release all of the resources?

Ping me if I can be of any help.

Ben

@cconstantine
Copy link

I'm getting this issue with mocha 1.2.2

@blackcoat
Copy link

I was getting this issue when using the '--watch' flag in 1.3.2, and upgrading to 1.6.0 resolved it for me. For anyone still experiencing the problem, I recommend updating mocha.

@safareli
Copy link

i am getting same error on version : 1.18.2

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
  at process.EventEmitter.addListener (events.js:160:15)
  at process.on.process.addListener (node.js:769:26)
  at Runner.run (/home/safareli/Web/audioviz/node_modules/mocha/lib/runner.js:588:11)
  at Mocha.run (/home/safareli/Web/audioviz/node_modules/mocha/lib/mocha.js:369:17)
  at Transform._flush (/home/safareli/Web/audioviz/node_modules/gulp-mocha/index.js:21:10)
  at Transform.<anonymous> (/home/safareli/Web/audioviz/node_modules/gulp-mocha/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:135:12)
  at Transform.g (events.js:180:16)
  at Transform.EventEmitter.emit (events.js:117:20)
  at finishMaybe (/home/safareli/Web/audioviz/node_modules/gulp-mocha/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:372:12)
  at endWritable (/home/safareli/Web/audioviz/node_modules/gulp-mocha/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:379:3)
  at Transform.Writable.end (/home/safareli/Web/audioviz/node_modules/gulp-mocha/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:357:5)
  at Transform.onend (/home/safareli/Web/audioviz/node_modules/gulp-cached/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:505:10)
  at Transform.g (events.js:180:16)
  at Transform.EventEmitter.emit (events.js:117:20)
  at /home/safareli/Web/audioviz/node_modules/gulp-cached/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:942:16
  at process._tickCallback (node.js:415:13)

@RavenHursT
Copy link

Awesome.. this is still around 2 years later and hasn't been addressed. I'm on 2.2.5 and I'm seeing the same error, which is causing my test server to skip tests... Can we get this addressed?

@boneskull
Copy link
Contributor

@RavenHursT sure! My rate is $150/hr.

Maybe it hasn't been addressed because it was closed, and nobody sent any sort of reproduction plan. So, you could start there. otherwise I'm afraid your chances are slim-to-none

@alexgetty
Copy link

Not sure if it matters, but I'm getting this error on Mocha 5.0.4

@g1eny0ung
Copy link

This warning also appears in Mocha 5.2.0.

@boneskull
Copy link
Contributor

if someone has a MCVE, please provide one in a new issue. Locking this issue.

@mochajs mochajs locked and limited conversation to collaborators Jan 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

No branches or pull requests

10 participants