mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
## Summary This PR fixes flaky E2E tests by replacing unreliable `networkidle` waits and hard-coded timeouts with deterministic waiting strategies. ### Changes Made #### 1. Replace `networkidle` with `domcontentloaded` + explicit waits - `networkidle` waits for zero network activity for 500ms, which times out in SPAs with persistent connections (WebSockets, polling, telemetry) - Replaced with `domcontentloaded` plus explicit element/URL waits #### 2. Replace hard-coded `waitForTimeout` with `waitForResponse` - `alerts-incidents-tabs.spec.js`: Use `waitForResponse` for `/config` API instead of `waitForTimeout(2000)` - `logs-regression.spec.js`: Use `waitForResponse` for `/streams` API instead of `waitForTimeout(3000)` #### 3. Fix Alerts/Incidents menu visibility timing - Increased timeout for incidents menu item (depends on `service_graph_enabled` from config API) - Added `waitFor` pattern before expect assertions in `alertsPage.js` - Use `waitForResponse` for search API after page refresh #### 4. Enable parallel test execution - Enable parallel mode in `ui-regression.spec.js` - Use unique stream names (with timestamp) to avoid test conflicts ## Files Changed | File | Changes | |------|---------| | `logs-regression.spec.js` | Replace networkidle → domcontentloaded, waitForTimeout → waitForResponse | | `ui-regression.spec.js` | Enable parallel mode, use waitForURL for navigation | | `alerts-incidents-tabs.spec.js` | Replace networkidle → domcontentloaded, waitForTimeout → waitForResponse | | `alertsPage.js` | Improve menu visibility waits, replace networkidle with domcontentloaded | ## Fixes - Alerts E2E test timeouts waiting for incidents menu item - logs-regression.spec.js: #9388 saved views, #9475 apostrophes - ui-regression.spec.js: #9325 header navigation, #9565 org_identifier ## Test Plan - [x] All alerts-incidents-tabs tests pass locally (3 passed, 2 skipped) - [x] logs-regression tests pass locally - [x] ui-regression tests pass locally - [x] Tests run in parallel successfully --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>