fix: disable global timeout when debugging (#34922)

This commit is contained in:
Yury Semikhatsky 2025-02-25 11:33:15 -08:00 committed by GitHub
parent 411f938296
commit aaac9923fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -92,7 +92,7 @@ export class FullConfigInternal {
fullyParallel: takeFirst(configCLIOverrides.fullyParallel, userConfig.fullyParallel, false),
globalSetup: this.globalSetups[0] ?? null,
globalTeardown: this.globalTeardowns[0] ?? null,
globalTimeout: takeFirst(configCLIOverrides.globalTimeout, userConfig.globalTimeout, 0),
globalTimeout: takeFirst(configCLIOverrides.debug ? 0 : undefined, configCLIOverrides.globalTimeout, userConfig.globalTimeout, 0),
grep: takeFirst(userConfig.grep, defaultGrep),
grepInvert: takeFirst(userConfig.grepInvert, null),
maxFailures: takeFirst(configCLIOverrides.debug ? 1 : undefined, configCLIOverrides.maxFailures, userConfig.maxFailures, 0),

View File

@ -164,6 +164,26 @@ test('should ignore test.setTimeout when debugging', async ({ runInlineTest }) =
expect(result.passed).toBe(1);
});
test('should ignore globalTimeout when debugging', {
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/34911' },
}, async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': `
export default {
globalTimeout: 100,
};
`,
'a.spec.ts': `
import { test, expect } from '@playwright/test';
test('my test', async ({ }) => {
await new Promise(f => setTimeout(f, 2000));
});
`
}, { debug: true });
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
});
test('should respect fixture timeout', async ({ runInlineTest }) => {
const result = await runInlineTest({
'a.spec.ts': `