Skip to content

fix(e2e): flaky Playwright tests — Vite cold start race on ARC runners #3917

Closed

Description

@PierreBrisorgueil

Problem

E2E tests intermittently fail with ERR_CONNECTION_REFUSED on localhost:8080 when running on ARC self-hosted K8s runners. The Playwright webServer config waits for the port to be available (30s timeout), but on CPU-constrained runners Vite sometimes takes longer to be fully ready.

Symptoms

  • auth.signup.e2e.tests.js — ERR_CONNECTION_REFUSED on page.goto('/signup')
  • billing.e2e.tests.js — ERR_CONNECTION_REFUSED or timeout waiting for heading
  • Always passes on rerun (second attempt has warm Vite cache)
  • Only happens on ARC K8s runners, never locally

Current config

// playwright.config.js
webServer: {
  command: `npx vite --port ${port}`,
  port,
  timeout: 30000, // 30s — may be too short on slow runners
}

Possible fixes

  1. Increase webServer.timeout to 60s or 90s
  2. Add retries: 1 to Playwright config for CI (env-conditional)
  3. Pre-build before E2E: run npx vite build or npx vite optimize before tests so deps are pre-bundled
  4. Use stdout: 'pipe' + reuseExistingServer with a readiness check on actual HTTP response (not just port binding)

Impact

Non-blocking (rerun always passes), but wastes CI time and creates noise.

Activity

  1. added a commit that references this issue on Apr 9, 2026
    a7f429d
  2. added a commit that references this issue on Apr 9, 2026
    534c7a7
  3. added a commit that references this issue on May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions