Files
openobserve/tests
ktx-akshayandClaude Opus 4.8 b689bfb507 test(e2e): fix flaky pipeline tests and cut Pipelines shard runtime ~50% (14.3m → ~6.5–7m) (#13118)
## Summary

The Pipelines E2E shard had **2 flaky tests** (`pipeline-core` →
`deletePipelineByName`
timing out) and ran in **~14.3 minutes**. This PR **fixes the
flakiness** and **cuts the
shard runtime by ~50%** — with **zero loss of test coverage** (every
assertion and test
step is preserved).

## 🎯 What we achieved

| Metric | Before | After |
|---|---|---|
| **Shard runtime** | ~14.3m | **~6.5–7.1m (~50% faster)** |
| **Flaky tests** | 2 | **0** |
| Tests passing | 83 | 85 |
| Test coverage | baseline | **unchanged** |

## 🔧 What we did

### Fixed the flakiness
- **Scoped pipeline cleanup** — `beforeEach` no longer runs a
**pool-wide cleanup** that
deleted sibling tests' in-flight pipelines under parallel execution.
**Each test now
  frees only its own source stream.**
- **Worker-suffixed streams** — each test uses **`_w${parallelIndex}`
stream names** so
  concurrent workers can **never collide** on shared streams.
- **List-scan race guard** — the `openFirst*` helpers **re-check the row
count each
iteration** instead of clicking a row a concurrent test deleted (**was a
45s hang**).

### Reduced runtime
- **Fixed the `dragStreamToTarget` phantom wait** — it waited **10 full
seconds** on a
selector that only exists for Stream nodes, so **every
query/condition/function drag
burned the full timeout**. Now it races all four node-form dialogs →
**each resolves in
  ~1s**. → **`scheduled` dropped 1.6m → ~37s from this fix alone.**
- **Trimmed `openPipelineMenu`** — replaced blind 1s+2s sleeps with a
**`waitFor` on a
  real condition**.
- **Parallelized the slow serial files** — flipped `pipeline-metrics`,
`pipeline-traces`,
and `pipelines-form-validation` from **`serial` → `parallel`** (each
**verified
  parallel-safe** first).

## ⚠️ What we intentionally did NOT do
- **No test steps, assertions, or validations were removed** — assertion
counts are
**identical before/after**. Only **redundant `waitForTimeout` idle**,
stream-name
  scoping, and serial→parallel config changed.
- **Load-bearing waits left untouched** — VueFlow canvas connects,
realtime-pipeline
  activation, and intentional dwells are **preserved**.
- **slowMo removal was tried and reverted** — **no reliable speedup**
(the suite is
  wait-bound, not action-bound) and it added a deployed-env dependency.

## 📉 Slow-file poles — before vs after

| File | Before | After |
|---|---|---|
| pipeline-metrics | 6.5m (serial) | **off slow list** |
| pipeline-traces | 5.5m (serial) | **off slow list** |
| pipelines-form-validation | 1.9m (serial) | **off slow list** |
| scheduled-pipeline-query-builder | 1.6m | **~42s** |

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 12:43:02 +00:00
..
2026-07-07 10:09:16 +00:00
2024-09-22 17:57:47 +08:00