Skip to content

fix(reporter): do not hang perfetto writes after a stream error - #42715

Open
Sebastien Tardif (SebTardif) wants to merge 2 commits into
microsoft:mainfrom
SebTardif:fix-perfetto-drain-error
Open

Sebastien Tardif (SebTardif) wants to merge 2 commits into
microsoft:mainfrom
SebTardif:fix-perfetto-drain-error

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Summary

  • Stop the Perfetto reporter from hanging when a write stream errors after backpressure.

Problem

ChunkWriter.write waited only on 'drain'. After write() returned false, an 'error' (for example ENOSPC or EISDIR) never fired drain, so onEnd hung.

Change

The drain waiter also listens for 'error'. The close promise resolves on 'error' as well as 'close' so close() can rethrow.

Validation

  • tests/playwright-test/reporter-perfetto.spec.ts: pointing outputFile at a directory makes the run fail instead of hanging.

A failed write after backpressure waited forever for drain. Reject
that wait on error and settle the close promise so the reporter
exits.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [firefox-library] › library/browsercontext-storage-state.spec.ts:453 › should work when service worker is intefering and the origin is not open @firefox-ubuntu-22.04-node20

2 flaky ⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`

51731 passed, 1247 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [firefox] › mcp/annotate.spec.ts:417 › should cancel browser_annotate when the MCP client disconnects @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-core.spec.ts:43 › click button @mcp-windows-latest-firefox

8562 passed, 1446 skipped


Merge workflow run.

Comment thread packages/playwright/src/reporters/perfetto.ts
Comment thread tests/playwright-test/reporter-perfetto.spec.ts Outdated
Listen for file-stream errors while waiting on gzip drain.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
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.

2 participants