Files
Charon/docs/plans/archive/current_spec.md.backup
akanealw eec8c28fb3
Some checks failed
Go Benchmark / Performance Regression Check (push) Has been cancelled
Cerberus Integration / Cerberus Security Stack Integration (push) Has been cancelled
Upload Coverage to Codecov / Backend Codecov Upload (push) Has been cancelled
Upload Coverage to Codecov / Frontend Codecov Upload (push) Has been cancelled
CodeQL - Analyze / CodeQL analysis (go) (push) Has been cancelled
CodeQL - Analyze / CodeQL analysis (javascript-typescript) (push) Has been cancelled
CrowdSec Integration / CrowdSec Bouncer Integration (push) Has been cancelled
Docker Build, Publish & Test / build-and-push (push) Has been cancelled
Quality Checks / Auth Route Protection Contract (push) Has been cancelled
Quality Checks / Codecov Trigger/Comment Parity Guard (push) Has been cancelled
Quality Checks / Backend (Go) (push) Has been cancelled
Quality Checks / Frontend (React) (push) Has been cancelled
Rate Limit integration / Rate Limiting Integration (push) Has been cancelled
Security Scan (PR) / Trivy Binary Scan (push) Has been cancelled
Supply Chain Verification (PR) / Verify Supply Chain (push) Has been cancelled
WAF integration / Coraza WAF Integration (push) Has been cancelled
Docker Build, Publish & Test / Security Scan PR Image (push) Has been cancelled
Repo Health Check / Repo health (push) Has been cancelled
History Rewrite Dry-Run / Dry-run preview for history rewrite (push) Has been cancelled
Prune Renovate Branches / prune (push) Has been cancelled
Renovate / renovate (push) Has been cancelled
Nightly Build & Package / sync-development-to-nightly (push) Has been cancelled
Nightly Build & Package / Trigger Nightly Validation Workflows (push) Has been cancelled
Nightly Build & Package / build-and-push-nightly (push) Has been cancelled
Nightly Build & Package / test-nightly-image (push) Has been cancelled
Nightly Build & Package / verify-nightly-supply-chain (push) Has been cancelled
changed perms
2026-04-22 18:19:14 +00:00

43 lines
1.9 KiB
Plaintext
Executable File

# Playwright E2E Test Timeout Fix - Feature Flags Endpoint
## 1. Introduction
### Overview
This plan addresses systematic timeout failures in Playwright E2E tests for the feature flags endpoint (`/feature-flags`) occurring consistently in CI environments. The tests in `tests/settings/system-settings.spec.ts` are failing due to timeouts when waiting for API responses during feature toggle operations.
### Problem Statement
Four tests are timing out in CI:
1. `should toggle Cerberus security feature`
2. `should toggle CrowdSec console enrollment`
3. `should toggle uptime monitoring`
4. `should persist feature toggle changes`
All tests follow the same pattern:
- Click toggle → Wait for PUT `/feature-flags` (currently 15s timeout)
- Wait for subsequent GET `/feature-flags` (currently 10s timeout)
- Both operations frequently exceed their timeouts in CI
### Root Cause Analysis
Based on comprehensive research, the timeout failures are caused by:
1. **Backend N+1 Query Pattern** (PRIMARY)
- `GetFlags()` makes 3 separate SQLite queries (one per feature flag)
- `UpdateFlags()` makes additional individual queries per flag
- Each toggle operation requires: 3 queries (PUT) + 3 queries (GET) = 6 DB operations minimum
2. **CI Environment Characteristics**
- Slower disk I/O compared to local development
- SQLite on CI runners lacks shared memory optimizations
- No database query caching layer
- Sequential query execution compounds latency
3. **Test Pattern Amplification**
- Tests explicitly set lower timeouts (15s, 10s) than helper defaults (30s)
- Immediate GET after PUT doesn't allow for state propagation
- No retry logic for transient failures
### Objectives
1. **Immediate**: Increase timeouts and add strategic waits to fix CI failures
2. **Short-term**: Improve test reliability with better wait strategies
3. **Long-term**: Document backend performance optimization opportunities