You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x] Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
[ x] Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
[x ] 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
[x ] Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you not install Mocha globally.
Listener is removed and then... Immedialtely another listener is added!
So if you use runner for running many tests, you will have all those listeners staying with you forever.
In my case, on project with 5000 tests I have a warning
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 501 uncaughtException listeners added to [process]. Use emitter.setMaxListeners() to increase limit
Steps to Reproduce
In description
Expected behavior:
I expect no listeners after runner ended,
Actual behavior:
Listeners stay.
Reproduces how often:
Always
Versions
mocha version 7.0.0
The text was updated successfully, but these errors were encountered:
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
When using mocha test runner, it does not remove uncaughtException listeners.
You can clearly see the issue in code line 919:
https://github.com/mochajs/mocha/blob/master/lib/runner.js
Listener is removed and then... Immedialtely another listener is added!
So if you use runner for running many tests, you will have all those listeners staying with you forever.
In my case, on project with 5000 tests I have a warning
Steps to Reproduce
In description
Expected behavior:
I expect no listeners after runner ended,
Actual behavior:
Listeners stay.
Reproduces how often:
Always
Versions
mocha version 7.0.0
The text was updated successfully, but these errors were encountered: