Mocha: CI tests: MaxListenersExceededWarning: Possible EventEmitter memory leak detected.

Created on 25 Nov 2019  路  3Comments  路  Source: mochajs/mocha

In the log files of our CI tests, following warnings can be found:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 uncaughtException listeners added to [process].

Please investigate, explain and evtl. fix those warnings.

confirmed-bug qa

Most helpful comment

Confirmed I've been seeing this bug for the last 3 weeks. Running on node 10, using mocha version 6.2.2. This outputs to the console while tests are running using either mocha or mocha --watch.

(node:13167) MaxListenersExceededWarning: 
Possible EventEmitter memory leak detected. 
11 uncaughtException listeners added to [process]. 
Use emitter.setMaxListeners() to increase limit

Suggested cause:

  • listeners are not being removed after they have been used and no longer needed

Many other libraries have faced this issue. See winston:

All 3 comments

Confirmed I've been seeing this bug for the last 3 weeks. Running on node 10, using mocha version 6.2.2. This outputs to the console while tests are running using either mocha or mocha --watch.

(node:13167) MaxListenersExceededWarning: 
Possible EventEmitter memory leak detected. 
11 uncaughtException listeners added to [process]. 
Use emitter.setMaxListeners() to increase limit

Suggested cause:

  • listeners are not being removed after they have been used and no longer needed

Many other libraries have faced this issue. See winston:

I described this bug in details here: https://github.com/mochajs/mocha/issues/4171

fixed by #4147.

Our CI tests still log a few warnings, but they are test specific and will be improved later.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdvinOlofsson picture EdvinOlofsson  路  3Comments

Swivelgames picture Swivelgames  路  3Comments

jamietre picture jamietre  路  3Comments

3p3r picture 3p3r  路  3Comments

niftylettuce picture niftylettuce  路  3Comments