pghalliday / node-BrowserStackTunnel

https://www.npmjs.com/package/browserstacktunnel-wrapper
MIT License
17 stars 24 forks source link

Tunnel leaks EventEmitter listeners #5

Closed pghalliday closed 9 years ago

pghalliday commented 10 years ago

The tests now report the following leak:

(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 BrowserStackTunnel.startTunnel (src/BrowserStackTunnel.js:125:13)
    at BrowserStackTunnel.start (src/BrowserStackTunnel.js:133:12)
    at Context.<anonymous> (/vagrant/test/src/BrowserStackTunnel.js:297:24)
    at Test.Runnable.run (/vagrant/node_modules/grunt-mocha-test/node_modules/mocha/lib/runnable.js:194:15)
    at Runner.runTest (/vagrant/node_modules/grunt-mocha-test/node_modules/mocha/lib/runner.js:355:10)
    at /vagrant/node_modules/grunt-mocha-test/node_modules/mocha/lib/runner.js:401:12
    at next (/vagrant/node_modules/grunt-mocha-test/node_modules/mocha/lib/runner.js:281:14)
    at /vagrant/node_modules/grunt-mocha-test/node_modules/mocha/lib/runner.js:290:7

I believe this is due to the tunnel code not cleaning up all the listeners it adds between start and stop. It became apparent as more tests were added which instantiated more and more tunnels

lucasfeliciano commented 10 years ago

Hey, was this bug fixed?

I'm into use your module to make a grunt plugin to automate the start and stop with tasks, it will be nice to know if it is all good to use it.

pghalliday commented 10 years ago

No it's not fixed as far as I know but I never deemed it serious enough to block use