Skip to content

fix(list reporter): decode multi-byte stdio chunks correctly across writes - #43143

Closed
Suparva (SuparvaCode) wants to merge 1 commit into
microsoft:mainfrom
SuparvaCode:fix/list-reporter-multibyte-stdio
Closed

Suparva (SuparvaCode) wants to merge 1 commit into
microsoft:mainfrom
SuparvaCode:fix/list-reporter-multibyte-stdio

Conversation

@SuparvaCode

Copy link
Copy Markdown

Summary

  • Since feat(list reporter): add printWorkerIndex option to prefix output with worker index #42886, ListReporter._dumpToStdio decoded worker stdio chunks directly with chunk.toString('utf-8'). When multi-byte UTF-8 sequences are split across chunk boundaries, chunk-by-chunk string decoding produced replacement characters (\uFFFD).
  • Maintain a per-worker/stream StringDecoder in ListReporter so partial multi-byte sequences are buffered until completed before formatting and emitting.
  • Flush incomplete sequences on reporter onEnd.
  • Added regression tests covering split multi-byte character chunks for both default stdio and worker-prefixed stdio.

Fixes #43079

…rites

References microsoft#43079.

In microsoft#42886, ListReporter._dumpToStdio decoded stdio chunks with chunk.toString('utf-8'). When multi-byte characters are split across chunk writes from worker processes, decoding chunk-by-chunk corrupted them into replacement characters.

Use StringDecoder from string_decoder per worker/stream to buffer incomplete multi-byte sequences across chunk boundaries, ensuring clean line-prefixing and uncorrupted terminal output.
@SuparvaCode

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]: list reporter corrupts test stdout/stderr that is not valid UTF-8 per chunk (multi-byte chars split across writes)

2 participants