Files
openobserve/tests/ui-testing
Shrinath RaoandClaude Opus 4.8 ec68ea02d7 test: retry transient ingestion fetch errors in pipeline regression (#12793)
## Problem

The **Pipelines-Regression** CI job was failing on the P0 test:

> `[chromium] › RegressionSet/Pipelines/pipeline-regression.spec.js:73 ›
should validate scheduled pipeline SQL query with metrics stream type`

Failure (all 4 attempts):

```
FetchError: Invalid response body while trying to fetch
http://localhost:5080/api/default/ingest/metrics/_json: Premature close
```

The error originates in `beforeEach`, inside
`pipelinesPage.ingestMetricsData()`. In the same setup, the global log
ingestion, trace ingestion, and RUM ingestion all succeeded — only the
metrics ingestion `fetch` threw.

## Root cause

`Premature close` / `ECONNRESET` / `socket hang up` are **transient**
`node-fetch` errors that happen when the server closes a keep-alive
socket before the response body is fully read. They are not real
ingestion failures. Because the throw happens in the `beforeEach` of a
**serial** describe block, a single flaky socket error fails the whole
suite.

There was no retry on any of the ingestion `fetch` calls in
`pipelinesPage.js`.

## Fix

Add a small `fetchWithRetry()` helper and use it for the three ingestion
calls (metrics, traces, bulk). It retries (with linear backoff) **only**
on transient network errors; real HTTP failures (non-2xx) are untouched
and still throw immediately.

## Verification

Ran locally against `localhost:5080`:

- Failing P0 test in isolation — **passed** (36.9s)
- Full `pipeline-regression.spec.js` suite — **7 passed** (3.4m)

## Notes

- Only `tests/ui-testing/pages/pipelinesPages/pipelinesPage.js` is
changed.
- The transient socket flake can't be reproduced against a healthy local
server; the local runs confirm the retry wrapper is transparent on
success (no regression).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 06:49:22 +00:00
..
2024-11-13 15:13:36 +05:30

zinc-observe-ui-automation

Playwright UI Testing

Installation

npm install

Running Tests

cd playwright-runner
npm start

Then open http://localhost:3000 to access the test runner interface.

Using Command Line

# Run all tests
npx playwright test

# Run specific test by tag
npx playwright test -g @alertsImportExport

# Run in headed mode
npx playwright test --headed

# Run specific test file
npx playwright test Alerts/alerts-import.spec.js

Environment Configuration

Tests can be configured using:

  1. Playwright Runner UI - Set environment variables through the web interface
  2. Environment Variables - Set variables in terminal or .env file