Repository navigation
fix(reporter): fail perfetto writes when the output stream errors #42715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
3949fd6
a12b55e
f98bd09
0cdc4a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,6 +215,24 @@ test('should report step params', async ({ runInlineTest }, testInfo) => { | |
| expect(findSlice(events, 'my step')!.args.params).toEqual({ foo: 'bar', count: 7 }); | ||
| }); | ||
|
|
||
| test('should fail when gzip perfetto output stream errors', async ({ runInlineTest }, testInfo) => { | ||
| test.skip(!fs.existsSync('/dev/full'), 'needs /dev/full'); | ||
| const gz = testInfo.outputPath('trace.json.gz'); | ||
| await fs.promises.symlink('/dev/full', gz); | ||
| const result = await runInlineTest({ | ||
| 'playwright.config.ts': ` | ||
| module.exports = { reporter: [['perfetto', { outputFile: ${JSON.stringify(gz)} }]] }; | ||
| `, | ||
| 'a.test.ts': ` | ||
| import { test } from '@playwright/test'; | ||
| test('one', async () => { | ||
| test.info().annotations.push({ type: 'blob', description: ${JSON.stringify('x'.repeat(64 * 1024))} }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this still passes without the fix because the repeated
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The test now writes incompressible data to a fifo and closes the reader so the dest stream errors. Without the dest listener the inner run exits 0. With it, exit is non-zero.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The test now writes a 256KB incompressible annotation to a directory named |
||
| }); | ||
| `, | ||
| }); | ||
| expect(result.exitCode).not.toBe(0); | ||
| }); | ||
|
|
||
| test('should respect outputFile option', async ({ runInlineTest }, testInfo) => { | ||
| const result = await runInlineTest({ | ||
| 'playwright.config.ts': ` | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.