Commit Graph
2 Commits
Author SHA1 Message Date
Shrinath Rao a384dd5ddd test(e2e/alpha1): robustness — auth self-heal + service-graph wide window (#13622)
## Alpha1 e2e robustness — self-healing auth + service-graph window

Builds on **#13621** (re-auth self-heal). Both branches share the slug
`test/alpha1-e2e-robustness` is stacked on `test/alpha1-reauth-on-401`;
review/merge #13621 first (or merge this, which contains it).

Root-caused against alpha1 runs 30892800970 / 30900015839 / 30902942856
(each investigated live via Playwright MCP).

### 1. Auth self-heal (from #13621, included here)
Shared cloud session + per-org passcode are minted once and reused all
run; on long runs / org-contention they expire mid-run → `User not
authenticated` (UI) and `HTTP 401 Unauthorized` (API). Now:
`authedRequest` refreshes the passcode and retries on 401;
`navigateToBase` re-authenticates and resumes instead of throwing.
**Verified working** in run 30902942856 — the auth storm cleared
(Metrics/SDR/Streams recovered, zero `User not authenticated`), and
`[auth] Refreshed cloud passcode after 401` fired and recovered mid-run.

### 2. Service graph queries a wide window
All 9 `service-graph.spec.js` chart tests failed with
`service-graph-chart` "element(s) not found" **despite** `beforeAll`
confirming topology via API (25 nodes). **Reproduced live**: the
service-graph tab defaults to **Past 15 Minutes** and shows *"No service
graph data / 0 entities"* (no chart element) when the daemon-processed
topology sits outside that window. The tab **honours the `period` URL
param** (verified: label → "Past 6 Hours").
→ `navigateToServiceGraphUrl` now navigates with `period=6h`; added
`navigateToServiceGraphAndWaitForChart()` (poll + refresh, tolerates
daemon lag). Non-masking.

### Honest scope
- **Not included (can't validate locally / not test-code):**
- **Pipelines ×5** (`Explore`/`update-pipeline` 45s timeout) —
persistent across *every* run; pipeline/stream data unavailable.
Env/data, needs CI-side repro.
- **OTLP metrics ingestion 401** (a PromQL-prereq `beforeAll`) — a
node-`fetch` ingest path with no page context to re-fetch the passcode;
narrow, needs a small refactor to self-heal.
- Singles: `logoManagement` (@enterprise `_meta`), `shareLink` (known
race), `alerts-ui-operations:131` (#9484) — pre-existing flaky/env.
- Service-graph is **enterprise/feature-gated** (403 in my org), so its
fix is evidence-reasoned + validated at the URL-param level, but final
proof is the seeded CI run.
2026-08-04 13:14:04 +00:00
befa1883a0 test: add alpha1 cloud compatibility for E2E logs tests (#10763)
## Summary
- Add cloud auth infrastructure (`cloud-env.js`, `cloud-auth.js`) for
cloud/self-hosted switching
- Centralize ingestion auth via `getAuthHeaders()` across all ingestion
utilities (data, trace, service-graph, metrics)
- Refactor `commonActions.js` from `exec(curl)` to `page.request.post()`
for cloud cookie compatibility
- Enhance `cloudLoginPage.js` + `page-manager.js` for conditional cloud
page objects
- Update `global-setup-alpha1.js` to fetch org identifier and passcode
from cloud session
- Fix `global-teardown.js` race condition with proper error handling
- Replace `console.log` with `testLogger` in `commonActions.js`,
`ingest-service-graph.spec.js`, `scripts/ingest-service-graph.js`
- Replace raw selectors with POM methods (`applyQueryButton`, VRL
editor, pagination, time range)
- Add missing test tags to `searchpartition`, `unflattened`,
`ingest-service-graph` specs
- Fix `networkidle` → `domcontentloaded` across multiple spec files

## Companion PR
- Enterprise: sets `IS_CLOUD=true` in alpha1 E2E workflow

## Test plan
- [ ] Self-hosted E2E tests pass (no behavioral changes — only routing
through POM + testLogger)
- [ ] Alpha1 cloud E2E tests pass with cloud auth enabled
- [ ] Verify no credential leaks in logs (passcode/password values never
logged)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Shrinath Rao <undefined@users.noreply.github.com>
2026-03-07 07:00:07 +05:30