|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
| 17 | +import { execFileSync } from 'child_process'; |
| 18 | +import * as crypto from 'crypto'; |
17 | 19 | import * as fs from 'fs'; |
18 | 20 | import * as path from 'path'; |
19 | 21 | import * as zlib from 'zlib'; |
@@ -216,20 +218,23 @@ test('should report step params', async ({ runInlineTest }, testInfo) => { |
216 | 218 | }); |
217 | 219 |
|
218 | 220 | test('should fail when gzip perfetto output stream errors', async ({ runInlineTest }, testInfo) => { |
219 | | - test.skip(!fs.existsSync('/dev/full'), 'needs /dev/full'); |
220 | 221 | const gz = testInfo.outputPath('trace.json.gz'); |
221 | | - await fs.promises.symlink('/dev/full', gz); |
| 222 | + execFileSync('mkfifo', [gz]); |
| 223 | + const reader = fs.createReadStream(gz); |
| 224 | + reader.on('error', () => {}); |
| 225 | + reader.once('data', () => reader.destroy()); |
222 | 226 | const result = await runInlineTest({ |
223 | 227 | 'playwright.config.ts': ` |
224 | 228 | module.exports = { reporter: [['perfetto', { outputFile: ${JSON.stringify(gz)} }]] }; |
225 | 229 | `, |
226 | 230 | 'a.test.ts': ` |
227 | 231 | import { test } from '@playwright/test'; |
228 | 232 | test('one', async () => { |
229 | | - test.info().annotations.push({ type: 'blob', description: ${JSON.stringify('x'.repeat(64 * 1024))} }); |
| 233 | + test.info().annotations.push({ type: 'blob', description: ${JSON.stringify(crypto.randomBytes(256 * 1024).toString('base64'))} }); |
230 | 234 | }); |
231 | 235 | `, |
232 | 236 | }); |
| 237 | + reader.destroy(); |
233 | 238 | expect(result.exitCode).not.toBe(0); |
234 | 239 | }); |
235 | 240 |
|
|
0 commit comments