WDIO 5 : Possible EventEmitter memory leak detected

575 Views Asked by At

I have a webdriverio test framework with maxInstance of the browser set to 10. When I run my script, I get the below error message

[local-test] (node:20572) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit

How can I get this fixed? I read some information online that I can suppress this warning by either process.setMaxListeners(10); or emitter.setMaxListeners(10) adding to the wdio.conf.js file;

But none of the fixed the issue. Also I do not want to suppress the warning and want to see if there is a way to do a clean fix? Kindly let me know.

PS : Its webdriverio / Mocha driven test automation framework and there is no database involved. Also I googled similar answers and it did not help.

1

There are 1 best solutions below

0
On

please refer this Node js documentation where it says under EventEmitter.defaultMaxListeners

The EventEmitter instance will allow more listeners to be added but will output a trace warning to stderr indicating that a "possible EventEmitter memory leak" has been detected.

It means we will get the warning message for such scenarios