You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: list reporter corrupts test stdout/stderr that is not valid UTF-8 per chunk (multi-byte chars split across writes) #43079
main @ 48688e0 (1.64.0-next); the code paths are unchanged in 1.63
Steps to reproduce
import{test}from'@playwright/test';test('split multi-byte char',async()=>{// "€\n" = e2 82 ac 0a, written in two chunksprocess.stdout.write(Buffer.from([0xe2,0x82]));process.stdout.write(Buffer.from([0xac,0x0a]));});
Run with npx playwright test --reporter=list.
Expected behavior
The terminal shows €, as it did before #42886, because the reporter wrote the raw bytes through to the stream.
Actual behavior
The terminal shows �� (two replacement characters). This happens with or without printWorkerIndex.
Since #42886 (printWorkerIndex), ListReporter._dumpToStdio does chunk.toString('utf-8') and writes the decoded string instead of chunk. Worker output reaches the reporter as Buffers (stdioChunkToParams sends Uint8Array chunks as base64), so each chunk is decoded on its own. A character split across two writes is lost, and so is any output that isn't UTF-8, such as Latin-1 from a child process. Decoding the two chunks separately gives "��\n", while the concatenated bytes give "€\n".
Additional context
Suggested fix: when there is no worker prefix to add, write the original chunk unchanged. When prefixing, decode with a per-stream StringDecoder (node:string_decoder) so partial sequences carry over to the next chunk. Low severity; found during a code review.
Environment
Not environment-specific: the code is platform-independent.
Verified by running the functions from packages/playwright-core/src/server (or the reporter logic) directly with Node 22.22 on Linux x64.
No browser is needed to reproduce.
Activity
dgozman commentedon Oct 6, 2026
Fixed by #43149.
CloneOfAlex commentedon Oct 6, 2026
nicely done - thanks