feat(ci): Add explicit timeout enforcement (Phase 2)

Resource Constraint Management:

Problem:
- Tests hanging indefinitely during execution in CI
- 2-core runners resource-constrained vs local dev machines
- No timeout enforcement allows tests to run forever

Changes:
1. playwright.config.js:
   - Reduced per-test timeout: 90s → 60s (CI only)
   - Comment clarifies CI resource constraints
   - Local dev keeps 90s for debugging

2. .github/workflows/e2e-tests-split.yml:
   - Added timeout-minutes: 15 to all test steps
   - Ensures CI fails explicitly after 15 minutes
   - Prevents workflow hanging until 6-hour GitHub limit

Expected Outcome:
- Tests fail fast with timeout error instead of hanging
- Clearer debugging: timeout vs hang vs test failure
- CI resources freed up faster for other jobs

Phase: 2 of 3 (Resource Constraints)
See: docs/plans/ci_hang_remediation.md
This commit is contained in:
GitHub Actions
2026-02-04 20:26:17 +00:00
parent dd16e98e82
commit 3c6d427ad7

View File

@@ -76,20 +76,27 @@ export default defineConfig({
/* Standard globalSetup - runs once before all tests */
globalSetup: './tests/global-setup.ts',
/* Timeouts */
/* Global timeout for each test - increased to 90s for feature flag propagation
* CI uses 60s to fail fast in resource-constrained environment (2-core runners)
*/
timeout: process.env.CI ? 60000 : 90000,
expect: { timeout: 5000 },
/* Parallelization */
/* Timeout for expect() assertions */
expect: {
timeout: 5000,
},
/* Run tests in files in parallel */
fullyParallel: true,
workers: process.env.CI ? 1 : undefined,
/* CI settings */
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
/* Reporters - simplified for CI */
/* Opt out of parallel tests on CI - single worker to avoid resource starvation */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters
* CI uses per-shard HTML reports (no blob merging needed).
* Each shard uploads its own HTML report for easier debugging.
*/
reporter: [
process.env.CI ? ['github'] : ['list'],
['html', { open: process.env.CI ? 'never' : 'on-failure' }],