Increase e2e test timeouts on CI to fix flaky tests (#37053)

Introduce a `GITEA_TEST_E2E_TIMEOUT_FACTOR` env var (3 on CI, 1 locally,
overridable) to scale Playwright e2e timeouts, fixing flaky tests like
`logout propagation` that timed out waiting for SSE event propagation on
slow CI runners.

| Timeout | Before (local) | After (local) | Before (CI) | After (CI) |
|---|---|---|---|---|
| expect | 3000 | 5000 | 6000 | 15000 |
| action | 3000 | 5000 | 6000 | 15000 |
| test | 6000 | 10000 | 12000 | 30000 |
| navigation | 6000 | 10000 | 12000 | 30000 |

---
This PR was written with the help of Claude Opus 4.6

---------

Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-03-31 15:59:25 +02:00
committed by GitHub
parent d288b4529b
commit f8d14b77eb
5 changed files with 25 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
import {env} from 'node:process';
import {defineConfig, devices} from '@playwright/test';
const timeoutFactor = Number(env.GITEA_TEST_E2E_TIMEOUT_FACTOR) || 1;
const timeout = 5000 * timeoutFactor;
export default defineConfig({
testDir: './tests/e2e/',
@@ -7,15 +9,15 @@ export default defineConfig({
testMatch: /.*\.test\.ts/,
forbidOnly: Boolean(env.CI),
reporter: 'list',
timeout: env.CI ? 12000 : 6000,
timeout: 2 * timeout,
expect: {
timeout: env.CI ? 6000 : 3000,
timeout,
},
use: {
baseURL: env.GITEA_TEST_E2E_URL?.replace?.(/\/$/g, ''),
locale: 'en-US',
actionTimeout: env.CI ? 6000 : 3000,
navigationTimeout: env.CI ? 12000 : 6000,
actionTimeout: timeout,
navigationTimeout: 2 * timeout,
},
projects: [
{