Skip to content

fix(playwright): stabilize IncidentManager test-suite pipeline trigger (2.0) - #30713

Merged
ShaileshParmar11 merged 1 commit into
2.0from
ShaileshParmar11/flaky-test-rca-2.0
Jul 30, 2026
Merged

ShaileshParmar11 merged 1 commit into
2.0from
ShaileshParmar11/flaky-test-rca-2.0

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Backport of the IncidentManager Playwright flakiness fix to 2.0. The main-branch PR is #30655; merging there will take time, so this ports the fix directly.

Problem

triggerTestSuitePipelineAndWaitForSuccess (used by IncidentManager E2E setup and re-run steps) timed out at the 300s poll in CI, failing the ingestion lane. Root cause, confirmed on a real Airflow 3.2.2 stack: Airflow 3.x accepts a trigger (HTTP 200) even before its dag-processor has serialized the freshly deployed DAG. That trigger creates an empty DagRun that finishes in ~0.03s, runs no task, and never writes a pipelineStatus — so the helper polls forever. The prior "retry until the trigger is accepted" assumption does not hold, because the trigger is accepted regardless of serialization state.

Fix (Playwright helper only)

  • Record a status baseline before triggering and wait for a run that differs by runId or newer timestamp (avoids asserting on the stale previous run, and avoids a deadlock when runId is absent — it is optional in the generated schema).
  • After triggering, wait up to 60s for a run to materialize; if none does (the empty-run signature, since it writes no status), re-trigger up to three times. A run that never materializes now fails loudly instead of hanging.

Scope

Only playwright/utils/incidentManager.ts is ported. The impact-map / CI-lane changes on the main PR are specific to main's test-selection setup (the ImportExport lane does not exist on 2.0). 2.0 already runs IncidentManager.spec.ts in the Ingestion lane, so the fix is exercised as-is.

Validation

🤖 Generated with Claude Code

Greptile Summary

This PR revises the IncidentManager Playwright pipeline helper to:

  • capture the previous pipeline-status baseline before triggering;
  • retry transient pipeline requests and re-trigger when no new run materializes;
  • poll the newly identified run until it succeeds or an explicit timeout is reached.

Confidence Score: 4/5

The PR is not yet safe to merge because current IncidentManager hooks and tests can time out before the new pipeline recovery sequence finishes.

The helper can spend up to three 60-second windows waiting for a run to materialize and then enter a 300-second success poll, while current callers include hooks and tests whose effective budgets are only 180 seconds and a setup hook capped at 420 seconds.

Files Needing Attention: openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts; openmetadata-ui/src/main/resources/ui/playwright/e2e/IncidentManager.spec.ts

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts Adds baseline-aware status detection, bounded request retries, empty-run re-triggering, and explicit success polling for IncidentManager pipeline execution.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read previous run baseline] --> B[Trigger pipeline]
  B --> C{New status materializes<br/>within 60 seconds?}
  C -->|No, attempts remain| B
  C -->|No, attempts exhausted| D[Throw no-run error]
  C -->|Yes| E[Poll new run for success]
  E -->|Success| F[Return]
  E -->|300-second timeout| G[Fail assertion]
Loading

Reviews (2): Last reviewed commit: "fix(playwright): stabilize IncidentManag..." | Re-trigger Greptile

@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner July 30, 2026 14:51
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Antd + Less Deprecation Guard

A new antd import or new .less file was added. Use UntitledUI + Tailwind for new work.

Affected files

at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
at Function._load (node:internal/modules/cjs/loader:1211:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49 {


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 18e77a66e9aa13d6d52a1a7fbc1fe3dd1ac75245 in Playwright run 30553803178, attempt 1.

✅ 539 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 45m 52s

⏱️ Max setup 2m 58s · max shard execution 15m 4s · max shard-job elapsed before upload 19m 8s · reporting 4s

🌐 202.41 requests/attempt · 2.85 app boots/UI scenario · 24.00% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 24% (convergence target: at most 15%).
  • Browser traffic was 202.41 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.85 per UI scenario (1598 boots / 560 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 86 0 0 0 0 0
✅ Shard chromium-02 99 0 0 0 0 0
✅ Shard chromium-03 105 0 0 3 0 0
✅ Shard chromium-04 109 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 23 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Backport of the IncidentManager flakiness fix from main (#30655) to 2.0.

The helper that triggers a test-suite ingestion pipeline and waits for success
had three problems that surface as flaky/timed-out runs in CI:

- It asserted on the previous run's status because it did not distinguish a
  genuinely new run from the stale latest record. It now records a baseline
  before triggering and waits for a run that differs by runId or timestamp.
- It could deadlock when neither the baseline nor the polled record carried a
  runId (the field is optional in the generated schema), so the new-run check
  treats a different runId OR a newer timestamp as sufficient.
- Airflow 3.x accepts a trigger (HTTP 200) even before its dag-processor has
  serialized the freshly deployed DAG. That trigger produces an empty DagRun
  that finishes instantly and never writes a pipelineStatus, so the helper
  polled the full 300s and timed out. It now waits up to 60s for a run to
  materialize and re-triggers (up to three times) when none does, since the
  empty run is only detectable by its absence.

Only the Playwright helper is ported; the impact-map/CI-lane changes from the
main branch are specific to main's test-selection setup (the ImportExport lane
does not exist on 2.0). 2.0 already runs IncidentManager.spec.ts in the
Ingestion lane, so the fix is exercised as-is.

Validated on a real Airflow 3.2.2 stack: the empty-DAG race reproduced
deterministically and the re-trigger recovered to success; full IncidentManager
spec 10/10, 0 flaky.

Co-Authored-By: Claude <noreply@anthropic.com>
@ShaileshParmar11
ShaileshParmar11 force-pushed the ShaileshParmar11/flaky-test-rca-2.0 branch from 18e77a6 to c505bb3 Compare July 30, 2026 16:07
@ShaileshParmar11
ShaileshParmar11 merged commit e1aaede into 2.0 Jul 30, 2026
54 of 57 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/flaky-test-rca-2.0 branch July 30, 2026 16:22
@gitar-bot

gitar-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Stabilizes the IncidentManager test-suite pipeline trigger in Playwright by establishing a status baseline and adding retry logic for unmaterialized DAG runs. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant