From 5306be88e39d5b4ff55b304d7d1e91cba06ba99b Mon Sep 17 00:00:00 2001 From: Shaishav Pidadi Date: Thu, 23 Apr 2026 16:07:49 -0400 Subject: [PATCH] test(nova): stabilize staging E2E against Render cold-starts (GOV-592) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OIDC login spec already exists in auth.spec.ts but was failing in CI because the warmup step only pinged precheck, while the chat app and Keycloak (both Render free-tier) were still cold when Playwright opened the first page — tripping the 30s navigationTimeout. - Warmup all three services (precheck, keycloak, chat) before running - Bump navigationTimeout 30s -> 60s and test timeout 60s -> 120s to absorb residual cold-start latency on the first navigation - Trace/screenshot/video retention on failure was already configured Co-Authored-By: Claude Opus 4.7 --- .github/workflows/e2e.yml | 30 ++++++++++++++++++++---------- playwright.config.ts | 4 ++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8d78c2e..34c97be 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -42,16 +42,26 @@ jobs: - name: Warm up staging services run: | echo "Waking up Render free-tier services..." - url="${{ secrets.STAGING_PRECHECK_URL }}/api/v1/health" - echo "Pinging $url" - for i in $(seq 1 10); do - if curl -sf --max-time 30 --connect-timeout 10 "$url" -o /dev/null; then - echo " ✓ precheck is up" - break - fi - echo " waiting... ($i/10)" - sleep 15 - done + + warmup() { + local name="$1" + local url="$2" + echo "Pinging $name at $url" + for i in $(seq 1 10); do + if curl -sfL --max-time 60 --connect-timeout 10 "$url" -o /dev/null; then + echo " ✓ $name is up" + return 0 + fi + echo " $name waiting... ($i/10)" + sleep 15 + done + echo " ✗ $name failed to wake up after 10 attempts" + return 1 + } + + warmup precheck "${{ secrets.STAGING_PRECHECK_URL }}/api/v1/health" + warmup keycloak "${{ secrets.STAGING_KEYCLOAK_URL }}/realms/governs-ai/.well-known/openid-configuration" + warmup chat "${{ secrets.STAGING_CHAT_URL }}/login" - name: Run E2E tests run: pnpm test:e2e diff --git a/playwright.config.ts b/playwright.config.ts index 9d94857..4c8f647 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ retries: process.env.CI ? 1 : 0, workers: 1, reporter: process.env.CI ? [['github'], ['html', { open: 'never' }]] : 'list', - timeout: 60_000, + timeout: 120_000, expect: { timeout: 15_000 }, use: { baseURL: CHAT_URL, @@ -22,7 +22,7 @@ export default defineConfig({ screenshot: 'only-on-failure', video: 'retain-on-failure', actionTimeout: 15_000, - navigationTimeout: 30_000, + navigationTimeout: 60_000, }, projects: [ {