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

@@ -88,10 +88,20 @@ GITEA_TEST_E2E_EMAIL="$GITEA_TEST_E2E_USER@$GITEA_TEST_E2E_DOMAIN"
--must-change-password=false \
--admin
# timeout multiplier, CI runners are slower
if [ -z "${GITEA_TEST_E2E_TIMEOUT_FACTOR:-}" ]; then
if [ -n "${CI:-}" ]; then
GITEA_TEST_E2E_TIMEOUT_FACTOR=3
else
GITEA_TEST_E2E_TIMEOUT_FACTOR=1
fi
fi
export GITEA_TEST_E2E_URL="$E2E_URL"
export GITEA_TEST_E2E_DOMAIN
export GITEA_TEST_E2E_USER
export GITEA_TEST_E2E_PASSWORD
export GITEA_TEST_E2E_EMAIL
export GITEA_TEST_E2E_TIMEOUT_FACTOR
pnpm exec playwright test "$@"