-
Notifications
You must be signed in to change notification settings - Fork 160
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
"Invalid string length" and memory issues #33
Labels
Comments
@adaphi Thanks for the detailed write up and example code. Very much appreciated. I'll take a look into this and see what I can do. |
Published 1.3.2 to fix this. |
Verified that this resolves the issue. Thanks @adamgruber for the quick fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
We've been having issues where using mochawesome as a reporter causes the node process to run out of memory. We have a fairly large number of tests to run (~800), but when run with no reporter they work just fine.
After vastly reducing the number of tests (to ~40) I managed to get the following related error:
Reducing it further (to 12!) then works fine.
The problem seems to be that each hook in the allHooks part of the object being passed to stringify (lib/mochawesome.js:116) contains two circular references - stringify does detect some of this but it results in a huge amount of duplicated stuff in the output. This vastly multiplies the impact of having many hooks alongside tests with a large body of content. When running with a large number of tests, the process runs out of memory before it is able to produce the error.
Attached is a file that will reproduce the problem, at least on my machine. Since it's a memory issue YMMV! It's a bit contrived but the idea is simply to show how a large number of hooks, tests, or a large test code body all contribute. Making the code body smaller doesn't entirely solve the issue, it just prevents it from happening until the test count is higher.
Versions:
node v4.3.2
mocha 2.4.5
mochawesome 1.3.1
Running via command line.
Is this something fixable?
mochawesomeMemTest.zip
The text was updated successfully, but these errors were encountered: