Skip to content

fix(json-reporter): surface RangeError from large merged reports#41233

Open
tsushanth wants to merge 1 commit into
microsoft:mainfrom
tsushanth:fix-40983
Open

fix(json-reporter): surface RangeError from large merged reports#41233
tsushanth wants to merge 1 commit into
microsoft:mainfrom
tsushanth:fix-40983

Conversation

@tsushanth

Copy link
Copy Markdown

Summary

  • JSON.stringify on a merged report >~512 MiB throws RangeError: Invalid string length and 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, downstream jq then dies with "Unexpected end of JSON input" and the user has no link back to the cause.
  • Catch the serialization failure in 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

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.
@tsushanth

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: JSON reporter silently produces 0-byte file when merged report exceeds V8 max string length

1 participant