Fixes 30654: wait for the newly triggered pipeline run in Playwright incident helper - #30655
Fixes 30654: wait for the newly triggered pipeline run in Playwright incident helper#30655ShaileshParmar11 wants to merge 2 commits into
Conversation
…revious one triggerTestSuitePipelineAndWaitForSuccess polled /pipelineStatus?limit=1 and accepted whatever the latest record was, with no notion of which run it had triggered. Airflow queues a DAG asynchronously, so ~2s after the trigger the previous run's `success` record is still the latest one: the helper returned immediately and callers went on to assert against stale results. In CI run 30439518657 that surfaced as "Resolving incident & re-run pipeline" reading an incident status of "Resolved" where it expected "New" — the poll had read run 178b5ca8 (success, recorded 2m17s before the trigger) while the new DAG was still queued, so no new failure or incident existed yet. Snapshot the run recorded before triggering, then poll until a record with a different runId (or a later timestamp) reaches success. Also fold the two fixed 5s "deployment settling time" sleeps into a bounded retry of the trigger request itself: the orchestrator rejects a trigger until the workflow is registered, so retry until it is accepted rather than paying 5s on every call. Co-Authored-By: Claude <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
… new run isNewRun required BOTH a different runId AND a later-or-equal timestamp. `runId` is optional in the generated PipelineStatus schema, so when neither the baseline nor the polled record carries one, `undefined !== undefined` is always false and the conjunction can never become true: the poll spins on Queued until the 300s timeout and the test fails — the opposite of the reliability this helper is meant to provide. Either signal alone is sufficient, and both still reject the stale record (same runId, same timestamp), so use a disjunction with a strict timestamp comparison. Reported by gitar-bot and greptile on #30655. Co-Authored-By: Claude <noreply@anthropic.com>
Code Review ✅ Approved 1 resolved / 1 findingsUpdates the Playwright incident manager helper to wait for the newly triggered pipeline run rather than accepting stale status records. The isNewRun predicate logic has been addressed. ✅ 1 resolved✅ Bug: isNewRun uses && where design/robustness needs ||
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 536 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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 25s ⏱️ Max setup 3m 24s · max shard execution 14m 39s · max shard-job elapsed before upload 18m 25s · reporting 4s 🌐 203.00 requests/attempt · 2.86 app boots/UI scenario · 10.13% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Describe your changes:
Fixes #30654
triggerTestSuitePipelineAndWaitForSuccesspolled/pipelineStatus?limit=1and accepted whatever the latest status record was, with no notion of which run it had triggered. Airflow queues a DAG asynchronously, so ~2s after the trigger the previous run'ssuccessrecord is still the latest one — the helper returned immediately and callers went on to assert against stale results.In run 30439518657 that surfaced as
Incident Manager › Resolving incident & re-run pipelinereading an incident status ofResolvedwhere it expectedNew: the poll read run178b5ca8(success, recorded 2m17s before the trigger) while the new DAG was stillqueued, so no new failure or incident existed yet. Serial-mode describe took 5 further tests down as skipped.What changed:
runIdor a latertimestampreachessuccess:fetchLatestPipelineStatus()(primary endpoint + entity fallback), previously inlined in the poll. It reportsfetchedseparately fromrunso a failed read is distinguishable from no run yet —fetchBaselineRun()retries and then throws rather than silently treating the stale previous run as new.waitForTimeout(5000)"deployment settling time" sleeps into a bounded retry of the trigger request itself — the orchestrator rejects a trigger until the workflow is registered, so we retry until it is accepted rather than paying 5s on every call. The twowaitForTimeoutcalls that remain are both backoffs inside retry loops (the trigger retry and the baseline-status retry) — neither runs unless a request actually failed.PipelineStatus/PipelineStateinstead of string literals.Net effect on runtime: the target test went 20.2s → 14.3s, whole spec file 2.8m → 2.4m.
Type of change:
High-level design:
N/A — single-file test-infrastructure fix.
Tests:
Use cases covered
beforeAllpath) still resolves —previousRunisundefinedand the first recorded run counts as new.Unit tests
Not applicable — this changes a Playwright helper. Jest is scoped to
src(roots: ['<rootDir>/src']) andplaywright.config.tsusestestDir: './playwright/e2e', so a test file for this helper has no home that CI would execute. The regression surface is the existingIncidentManager.spec.ts.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.tsManual testing performed
Live E2E —
IncidentManager.spec.tsagainst a running stack onlocalhost:8585:Covers all three re-run call sites (lines 869, 950, 1178) plus the never-run-before path in
beforeAll.Replay harness — a throwaway spec driving the real exported helper against a stub
APIRequestContextreplaying the exact responses recorded in run 30439518657 (previous run178b5ca8/success/ ts1785320083346, then a new runId), countingpipelineStatusreads:resolved after 1 pipelineStatus call(s)— Expected 3, Received 1beforeAllpath)pipelineStatusdown → entity fallbackrunIdis absent on both recordsReceived: 1is the bug reproduced exactly — the old helper returns on its first poll, off the stale record. The harness was deleted after verifying (see "Unit tests" above for why it has no home in CI).Static —
yarn tsc:playwright: 163 errors before and after (pre-existing baseline for the playwright project), 0 in the changed file. ESLint + Prettier + organize-imports on the changed file: clean, no residual diff.Caveat, stated plainly: the live E2E passes with and without this change. The local stack is Argo-backed and does not reproduce the window; the trace shows Airflow still
queued2s after the trigger. So the live run is a non-regression check, and the replay harness is what evidences the cure. CI's Airflow-backed Ingestion lane is the real confirmation.UI screen recording / screenshots:
Not applicable — no UI change.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Review follow-up
isNewRunas originally pushed used&&with>=, not the||/>this description claimed — the description was written from a revision that differed from the committed one. gitar-bot and greptile both caught it.runIdis optional in the generatedPipelineStatusschema, so with a conjunction, two records that both omit it giveundefined !== undefined→falseforever, and the poll spins to the 300s timeout. Reproduced: that scenario hangs on the conjunction and passes in 2.0s on the disjunction. Fixed in 380cc2f, and the harness now covers it.🤖 Generated with Claude Code
Greptile Summary
The Playwright incident helper now waits for the pipeline run initiated by the current trigger.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Test as Playwright helper participant API as OpenMetadata API participant Orchestrator as Pipeline orchestrator Test->>API: Read latest pipeline status baseline Test->>API: Trigger pipeline (bounded retries) API->>Orchestrator: Queue new run loop Until new run succeeds Test->>API: Read latest pipeline status API-->>Test: Latest run ID, timestamp, and state end Test-->>Test: Continue incident assertionsReviews (2): Last reviewed commit: "fix(playwright): treat runId or timestam..." | Re-trigger Greptile