diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index a36b7437d2..2d7329a027 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -148,7 +148,7 @@ export default defineConfig({ * since: v1.10 - type: ?<[int]> -Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on CI to prevent broken setup from running too long and wasting resources. Note that even if global timeout is reached, Playwright will still allow up to 30 extra seconds for teardown hooks to finish. Learn more about [various timeouts](../test-timeouts.md). +Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on CI to prevent broken setup from running too long and wasting resources. Learn more about [various timeouts](../test-timeouts.md). **Usage** diff --git a/packages/playwright/src/runner/taskRunner.ts b/packages/playwright/src/runner/taskRunner.ts index d49b1c4295..a5508c32be 100644 --- a/packages/playwright/src/runner/taskRunner.ts +++ b/packages/playwright/src/runner/taskRunner.ts @@ -105,14 +105,9 @@ export class TaskRunner { status = 'failed'; } cancelPromise?.resolve(); - const cleanup = async () => { - // Upon hitting deadline we add extra 30s to actually perform cleanup, otherwise - // the task exits immediately because of the same deadline and we may continue - // while the test workers are still running. - const extraTime = timeoutWatcher.timedOut() ? 30_000 : 0; - const { status } = await teardownRunner.runDeferCleanup(context, deadline + extraTime); - return status; - }; + // Note that upon hitting deadline, we "run cleanup", but it exits immediately + // because of the same deadline. Essentially, we're not performing any cleanup. + const cleanup = () => teardownRunner.runDeferCleanup(context, deadline).then(r => r.status); return { status, cleanup }; } } diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 993e7addd1..635356f9c7 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -1101,8 +1101,7 @@ interface TestConfig { /** * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on - * CI to prevent broken setup from running too long and wasting resources. Note that even if global timeout is - * reached, Playwright will still allow up to 30 extra seconds for teardown hooks to finish. Learn more about + * CI to prevent broken setup from running too long and wasting resources. Learn more about * [various timeouts](https://playwright.dev/docs/test-timeouts). * * **Usage** diff --git a/tests/playwright-test/reporter-base.spec.ts b/tests/playwright-test/reporter-base.spec.ts index 620e78f1bf..bd04cb2dfa 100644 --- a/tests/playwright-test/reporter-base.spec.ts +++ b/tests/playwright-test/reporter-base.spec.ts @@ -230,7 +230,8 @@ for (const useIntermediateMergeReport of [false, true] as const) { }); expect(result.exitCode).toBe(1); expect(result.passed).toBe(1); - expect(result.interrupted).toBe(1); + // TODO: uncomment once https://github.com/microsoft/playwright/issues/30550 is fixed. + // expect(result.interrupted).toBe(1); expect(result.didNotRun).toBe(1); expect(result.output).toContain('Timed out waiting 3s for the test suite to run'); }); diff --git a/tests/playwright-test/runner.spec.ts b/tests/playwright-test/runner.spec.ts index 617dab904e..701b1e825d 100644 --- a/tests/playwright-test/runner.spec.ts +++ b/tests/playwright-test/runner.spec.ts @@ -776,6 +776,8 @@ test('unhandled exception in test.fail should restart worker and continue', asyn }); test('wait for workers to finish before reporter.onEnd', async ({ runInlineTest }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30550' }); + test.fixme(); const result = await runInlineTest({ 'playwright.config.ts': ` export default {