fix(reporters): do not truncate piped output on exit#41454
Conversation
StripAnsiStream buffered chunks in the Writable internal queue and forwarded them to the target stream asynchronously via _write. When the runner exits via process.exit() before those chunks are flushed, the tail of the output is lost on large suites when piped/redirected. Forward synchronously to the target instead. Fixes microsoft#41449
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| override _write(chunk: any, encoding: any, callback: any) { | ||
| this._target.write(stripAnsiEscapes(chunk.toString()), callback); | ||
| // Forward synchronously to the target stream instead of going through the |
There was a problem hiding this comment.
It seems like this code is supposed to handle it already.
Test results for "MCP"4 failed 7379 passed, 1132 skipped Merge workflow run. |
Test results for "tests 1"3 failed 6 flaky49079 passed, 1156 skipped Merge workflow run. |
Summary
StripAnsiStream(added in fix(reporter): strip ansi from test stdout when colors are disabled #40688) buffered output in theWritableinternal queue and flushed it to the target stream asynchronously via_write. On large suites, when output is piped/redirected,process.exit()could fire before those chunks were flushed, dropping the tail of the output.Fixes #41449