Files
openobserve/tests
Shrinath Rao 18a53716f6 test(traces): heal service-graph Metrics-tab correlation detection (#13674)
## What

Fixes the one remaining alpha1 Traces failure after the service-graph
route deploy: **`service-graph.spec.js` → P1: Show telemetry correlation
from node panel via Metrics tab**. Test-only, no product change.

## Root cause

The test asserted on two hooks that never reach the DOM:

- `service-graph-side-panel-metrics` sits on an `OTabPanel` whose
`data-test` is **swallowed by `<Transition>`**.
- `service-graph-side-panel-metrics-dashboard` is passed to
`<TelemetryCorrelationDashboard>`, which has **multiple top-level
roots** (dialog `ODrawer` / embedded `div` / `ODialog`) → it renders a
**Vue fragment**, and Vue 3 **drops fallthrough attrs on fragment
roots**, so the `data-test` is never applied.

On alpha (which seeds only traces, no metrics), the correlation returns
a **zero-stream dashboard object**: the dashboard branch renders (so the
parent empty-state is suppressed), but there are no stream rows and the
dashboard hook doesn't exist → the test's `else` branch `expect(hasError
|| hasEmpty)` fails. The test only ever passed before when correlation
happened to return *empty*; it broke as soon as real correlation data
appeared.

Confirmed live on the deployed build: after clicking Metrics, the panel
wrapper `data-test` is absent, while the correlation view's real content
(`correlation-event-header-*`, metric selector) renders fine.

## Fix

Wait on the correlation view's **real rendered content** — the
correlation event header, or a terminal empty/error state — instead of
the swallowed/dropped wrappers, and assert only that the Metrics tab
**resolves** (the helper throws if nothing renders, catching a genuinely
broken tab). Metric-stream rows are asserted only on the happy path when
data is present.

Deploy-independent: every element it waits on ships on the current build
(verified), so it won't reintroduce the main-vs-deployed skew.

## Validation

`--workers=1 --retries=0` against alpha on the previously-failing test:
- 1 run → passed
- `--repeat-each=2` → 2/2 passed

`Metrics tab resolved: streamsPresent=false → resolved with no
correlated streams (acceptable) → Test PASSED`

## Context

The other 9 service-graph failures were the missing
`/traces/service-graph` route (#13659) and cleared on deploying latest
`main`. Sibling fixes from the same alpha1 triage: openobserve#13672
(alerts move flake), o2-enterprise#2370 (per-org cleanup).
2026-08-07 01:26:07 +00:00
..
2024-09-22 17:57:47 +08:00