Skip to content

fix(playwright): re-trigger when a test-suite pipeline run never leaves the queue - #30875

Merged
ShaileshParmar11 merged 1 commit into
mainfrom
ShaileshParmar11/incident-empty-dag-retrigger
Aug 4, 2026
Merged

fix(playwright): re-trigger when a test-suite pipeline run never leaves the queue#30875
ShaileshParmar11 merged 1 commit into
mainfrom
ShaileshParmar11/incident-empty-dag-retrigger

Conversation

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Follow-up to #30789 (already merged).

Problem

IncidentManager tests that keep a real pipeline (the main beforeAll and the re-run tests) intermittently fail in CI with Received: "queued" → 300s timeout. Confirmed from a merge-queue run's Airflow diagnostics: the freshly-deployed DAG isn't serialized when OM triggers it (AirflowRESTClient: 404 "DAG … not found"), so the DagRun executes empty (run_duration=0.026s, no task) and writes no status. In the trace this shows as a brief queued status followed by an empty pipelineStatus.

Why the existing recovery missed it

waitForNewRunToAppear re-triggers only when no run appears — but the empty-DAG race produces a transient queued run, and the check counted any run as "materialized", so it skipped the re-trigger. The run then vanished and the success poll waited out the full timeout.

Fix

Require the run to have actually left the queue before counting it:

if (
  run &&
  isNewRun(run) &&
  run.pipelineState !== undefined &&
  run.pipelineState !== PipelineState.Queued
) {
  return true;
}

A real run leaves queued within seconds; the empty-DAG run never does. So the transient queued no longer short-circuits the existing re-trigger loop, which fires and triggers again against the now-serialized DAG. If even that fails 3× (pathological saturation) it throws a clear error instead of the silent 300s hang.

Scope / validation

  • One-line-ish change to the shared helper; ESLint/Prettier/tsc clean.
  • Behavioral validation is via CI under load — the race is an Airflow-3.x, load-dependent timing bug and can't be reproduced on a non-Airflow local stack. The change only makes the appearance check stricter and reuses the already-shipped re-trigger path, so it's low-risk.
  • Note: the durable fix for the UI tests is seeding incidents (landed for pagination in test(playwright): seed IncidentManager pagination incidents instead of running a pipeline #30789; lifecycle/tab/filters is a further follow-up). This patch hardens the tests that genuinely keep a pipeline. The underlying product race (deploy returns before the DAG is serialized) is a separate backend concern.

🤖 Generated with Claude Code

…es the queue

The empty-DAG race (Airflow 3.x accepts a trigger before the dag-processor has
serialized the freshly deployed DAG) has two shapes: the trigger writes no
status at all, OR it produces a transient `queued` run that then vanishes when
the empty DAG finishes instantly with no task.

waitForNewRunToAppear treated any new run — including that transient `queued` —
as "materialized", so it skipped the re-trigger recovery; the run then vanished
and the success poll waited out the full timeout (seen in CI as a `queued`
status followed by an empty pipelineStatus). Require the run to have actually
LEFT the queue (non-`queued` state) before counting it, so the transient
`queued` no longer short-circuits the re-trigger — a real run leaves the queue
within seconds, the empty-DAG run never does.

Follow-up to #30789.

Co-Authored-By: Claude <noreply@anthropic.com>
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner August 3, 2026 12:35
Copilot AI review requested due to automatic review settings August 3, 2026 12:35
@github-actions

github-actions Bot commented Aug 3, 2026

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 Aug 3, 2026
@gitar-bot

gitar-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates the Playwright test helper to check that pipeline runs actually leave the queued state before considering them materialized, preventing 300-second timeouts caused by empty 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the Playwright IncidentManager pipeline-trigger helper against an Airflow race where a freshly deployed DAG can briefly report a queued run and then produce no durable pipelineStatus, leading to a full timeout wait.

Changes:

  • Tightens the “new run appeared” check to require the latest run to be both new and not in PipelineState.Queued.
  • Expands inline documentation to explain the transient-queued / empty-DAG failure mode and why it previously bypassed the re-trigger loop.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 6a78fbffb33d8004db7fdbff6afa6375a6651c42 in Playwright run 30814215242, attempt 1.

✅ 768 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) 52m 7s

⏱️ Max setup 2m 53s · max shard execution 18m 0s · max shard-job elapsed before upload 21m 25s · reporting 4s

🌐 200.81 requests/attempt · 2.65 app boots/UI scenario · 11.57% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 200.81 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.65 per UI scenario (2121 boots / 800 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 124 0 0 3 0 0
✅ Shard chromium-02 140 0 0 0 0 0
✅ Shard chromium-03 156 0 0 0 0 0
✅ Shard chromium-04 140 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 34 0 0 0 0 0
✅ Shard import-export-01 26 0 0 0 0 0
✅ Shard ingestion-01 29 0 0 0 0 0
✅ Shard reindex-01 5 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

@ShaileshParmar11 ShaileshParmar11 self-assigned this Aug 3, 2026
@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit 98284db Aug 4, 2026
77 of 79 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/incident-empty-dag-retrigger branch August 4, 2026 01:31
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.

4 participants