From 24ea067cd9ebeefcbbf2af60ea7eef172dd45a7b Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Tue, 16 Dec 2025 21:48:58 +0000 Subject: [PATCH] fix(ci): add timeouts to prevent 6-hour hangs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 30-minute job-level timeouts for Tests and E2E Tests - Add step-level timeouts: 10min unit tests, 15min integration/e2e - Add vitest testTimeout (30s) and hookTimeout (30s) Prevents infinite retry loops from blocking CI for hours. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 5 +++++ vitest.config.mts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79dd4f5..c93216c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,6 +82,7 @@ jobs: name: Tests runs-on: ubuntu-latest needs: [lint, typecheck] + timeout-minutes: 30 # Prevent 6-hour hangs services: postgres: image: postgres:17 @@ -116,6 +117,7 @@ jobs: - name: Run Unit Tests run: pnpm test:unit + timeout-minutes: 10 env: CSRF_SECRET: test-csrf-secret PAYLOAD_SECRET: test-payload-secret @@ -148,6 +150,7 @@ jobs: - name: Run Integration Tests run: pnpm test:int + timeout-minutes: 15 env: CSRF_SECRET: test-csrf-secret PAYLOAD_SECRET: test-payload-secret @@ -227,6 +230,7 @@ jobs: name: E2E Tests runs-on: ubuntu-latest needs: [build] + timeout-minutes: 30 # Prevent 6-hour hangs services: postgres: image: postgres:17 @@ -290,6 +294,7 @@ jobs: - name: Run E2E tests run: pnpm test:e2e + timeout-minutes: 15 env: CI: true CSRF_SECRET: e2e-csrf-secret-placeholder diff --git a/vitest.config.mts b/vitest.config.mts index be40568..2dacadb 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -7,6 +7,8 @@ export default defineConfig({ test: { environment: 'jsdom', setupFiles: ['./vitest.setup.ts'], + testTimeout: 30000, // 30 seconds per test + hookTimeout: 30000, // 30 seconds for beforeAll/afterAll include: [ 'tests/int/**/*.int.spec.ts', 'tests/unit/**/*.unit.spec.ts',