fix(json-reporter): surface RangeError from large merged reports#41233
Open
tsushanth wants to merge 1 commit into
Open
fix(json-reporter): surface RangeError from large merged reports#41233tsushanth wants to merge 1 commit into
tsushanth wants to merge 1 commit into
Conversation
Fixes: microsoft#40983 `JSON.stringify` throws `RangeError: Invalid string length` once the merged report exceeds V8's ~512 MiB string limit. The multiplexer would catch the error as a generic "Error in reporter" warning and the merge command would exit 0, leaving the shell-redirected output file at 0 bytes — downstream `jq` then died with "Unexpected end of JSON input" with no link back to the real cause. Catch the serialization failure, write a small parseable JSON describing the failure (so the output isn't an empty file), and rethrow with an actionable message explaining the V8 limit and suggesting the blob reporter for large sharded runs.
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JSON.stringifyon a merged report >~512 MiB throwsRangeError: Invalid string lengthand the multiplexer logs it as a generic "Error in reporter" warning while the merge command exits 0 — shell-redirected output is left at 0 bytes, downstreamjqthen dies with "Unexpected end of JSON input" and the user has no link back to the cause.outputReport, write a small parseable JSON describing the failure (so the file isn't empty / unparseable), and rethrow with an actionable message about V8's max string length and the blob-reporter workaround.Fixes #40983