-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Maximum call stack size exceeded error coming from reporter/global-reporter.js #3647
Comments
Hey @kretschmannj, Could you provide a sample test/steps to replicate the issue? |
I was unable to reproduce this problem and I haven't seen it since I opened this issue. Therefore, I'm going to close this. |
This problem is back and it's a blocker. I'm running a large test and this error seems to be triggered when there are errors. I'm on Nightwatch v2.6.18 and I'm tempted to roll back to some previous version to see if this helps. However, this is a major undertaking as I need to run the entire test suite to reproduce the problem and this can take upwards of 30 minutes per run. Have there been any recent updates to the Nightwatch reporter? |
After much research, I have found the issue. I use a package called nightwatch-xhr to capture XHR responses from the browser. These responses go into the testResults object which is then processed by the global-reporter.js at the end of the test. The global-reporter.js utilizes ansi-to-html to process the results and it turns out that one of these XHR responses is HUGE (2.6MB) and this is causing ansi-to-html to blow up with the RangeError: Maximum call stack size exceeded error. Root cause seems to be that ansi-to-html has a limit on how much data it can process. Perhaps I'll open an issue in their GitHub project. In the meantime, I'll remove the commands in my test that are capturing these XHR responses. |
Turns out there's already an issue logged for this in ansi-to-html ... logged over 2 years ago ... There is, however, a bug that was introduced in some of the recent changes to the NIghtwatch reporter. Previously, running in v2.4.1 I would get the call stack error but Nightwatch would run to completion and the results file would be generated. However, when I upgrade to version 2.6.x then Nightwatch aborts when it hits the call stack error and no results file is generated. So it seems Nightwatch is no longer handling the situation in which ansi-to-html barfs. |
@kretschmannj thank you for the analysis, yes this looks like a bug in |
Description of the bug/issue
Error
931 | uncaughtException: Maximum call stack size exceeded
932 | RangeError: Maximum call stack size exceeded
933 | at String.replace ()
934 | at process (/codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/ansi-to-html/lib/ansi_to_html.js:507:17)
935 | at tokenize (/codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/ansi-to-html/lib/ansi_to_html.js:517:7)
936 | at Filter.toHtml (/codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/ansi-to-html/lib/ansi_to_html.js:605:7)
937 | at /codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/nightwatch/lib/reporter/global-reporter.js:69:39
938 | at Array.map ()
939 | at GlobalReporter.addTestSuiteResults (/codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/nightwatch/lib/reporter/global-reporter.js:67:43)
940 | at Concurrency. (/codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/nightwatch/lib/reporter/global-reporter.js:85:14)
941 | at Concurrency.emit (events.js:400:28)
942 | at ChildProcess. (/codebuild/output/src055282788/src/github.com/magellan-health/portal-ui-tests/node_modules/nightwatch/lib/runner/concurrency/index.js:181:12)
Steps to reproduce
No response
Sample test
No response
Command to run
No response
Verbose Output
No response
Nightwatch Configuration
No response
Nightwatch.js Version
2.6.18
Node Version
No response
Browser
No response
Operating System
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: