chore: fix codegen SIGINT test (#34468)

This commit is contained in:
Adam Gastineau 2025-01-24 14:21:42 -08:00 committed by GitHub
parent 9d91d7a1e9
commit fccb2b0784
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -459,8 +459,13 @@ await page1.GotoAsync("about:blank?foo");`);
const cli = runCLI([`--save-storage=${storageFileName}`, `--save-har=${harFileName}`]);
await cli.waitFor(`import { test, expect } from '@playwright/test'`);
await cli.process.kill('SIGINT');
const { exitCode } = await cli.process.exited;
expect(exitCode).toBe(130);
const { exitCode, signal } = await cli.process.exited;
if (exitCode !== null) {
expect(exitCode).toBe(130);
} else {
// If the runner is slow enough, the process will be forcibly terminated by the signal
expect(signal).toBe('SIGINT');
}
expect(fs.existsSync(storageFileName)).toBeTruthy();
expect(fs.existsSync(harFileName)).toBeTruthy();
});