Skip to content

fix(reporters): do not truncate piped output on exit#41454

Merged
pavelfeldman merged 2 commits into
microsoft:mainfrom
pavelfeldman:fix-41449
Jun 25, 2026
Merged

fix(reporters): do not truncate piped output on exit#41454
pavelfeldman merged 2 commits into
microsoft:mainfrom
pavelfeldman:fix-41449

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • StripAnsiStream (added in fix(reporter): strip ansi from test stdout when colors are disabled #40688) buffered output in the Writable internal 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.
  • Forward synchronously to the target stream instead, restoring the pre-1.61 direct-write behavior while still stripping ANSI.

Fixes #41449

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
@github-actions

This comment has been minimized.

@github-actions

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this code is supposed to handle it already.

@pavelfeldman pavelfeldman merged commit cc01132 into microsoft:main Jun 25, 2026
39 of 46 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

4 failed
❌ [chromium] › mcp/http.spec.ts:349 › client should receive list roots request @mcp-macos-latest-chromium
❌ [chromium] › mcp/http.spec.ts:349 › client should receive list roots request @mcp-ubuntu-latest-chromium
❌ [firefox] › mcp/http.spec.ts:349 › client should receive list roots request @mcp-ubuntu-latest-firefox
❌ [webkit] › mcp/http.spec.ts:104 › http transport browser lifecycle (isolated) @mcp-ubuntu-latest-webkit

7379 passed, 1132 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

3 failed
❌ [chromium-library] › library/browsercontext-add-init-script.spec.ts:28 › should work without navigation, after all bindings @chromium-ubuntu-22.04-arm-node20
❌ [chromium-library] › library/browsercontext-expose-function.spec.ts:77 › should be callable from-inside addInitScript @chromium-ubuntu-22.04-arm-node20
❌ [playwright-test] › fixture-errors.spec.ts:746 › should not continue with scope teardown after fixture teardown timeout @ubuntu-latest-node22

6 flaky ⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:177 › serviceWorker(), and fromServiceWorker() work `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:299 › should report intercepted service worker requests in HAR `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/har-websocket.spec.ts:235 › should attach websocket messages `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:680 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`

49079 passed, 1156 skipped


Merge workflow run.

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.

[Regression]: Output is truncated when piped

2 participants