Skip to content

fix(playwright): wait for the blocking Airflow deploy before asserting - #34055

Merged
ShaileshParmar11 merged 4 commits into
mainfrom
ShaileshParmar11/playwright-wait-for-blocking-deploy
Sep 25, 2026
Merged

ShaileshParmar11 merged 4 commits into
mainfrom
ShaileshParmar11/playwright-wait-for-blocking-deploy

Conversation

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Summary

Since #33883, the Airflow 3 deploy call keeps the request open until the scheduler registers the DAG (_wait_for_dag_registration, up to 60s). In CI, deploy went from about 0.1s to 15–19s. Add Column Test Case then waited only 15s for the test case page, which the UI opens after deploy answers, so it failed on every ingestion-lane run that included #33883 (run).

click(create-btn)
  POST /testCases              201
  POST /ingestionPipelines     201
  POST /ingestionPipelines/deploy/{id}   ← 17,158 ms (server access log)
  drawer closes, test case page opens
expect(entity-header-name).toHaveText   ← gave up at 15,000 ms

The change: wait for the deploy to finish, then assert.

 // AddTestCaseNewFlow.spec.ts › createTestCase()
   click(create-btn); await testCase response (+ pipeline response)
-  if (!expectSchedulerCard) expect(ingestionPipelineCalled).toBe(false)
+  await test-case-form-v1 detached      // closes only after deploy answers
+  if (!expectSchedulerCard) expect(ingestionPipelineCalled).toBe(false)

 // TestSuitePipelineRedeploy.spec.ts
+  test.slow()
-  expect.poll(deploy results, { timeout: 30_000 })
+  expect.poll(deploy results, { timeout: 90_000 })   // 60s registration wait + margin

 // ServiceBaseClass.scheduleIngestion (nightly ServiceIngestion)
-  page.waitForRequest('/deploy/**')
+  page.waitForResponse('/deploy/**')    // success line renders only after the response

Moving the no-pipeline check after the drawer closes also fixes a check that could never fail. It used to run right after the test-case response, before a pipeline POST could arrive.

How I chose these three

I compared per-test durations from the ingestion-lane playwright-timings artifacts, 16 before #33883 and 23 after, and read each deploy-dependent flow in the tests that slowed down:

  • The other slowed tests were already safe. TestSuiteMultiPipeline, utils/dataQuality.ts, and DataQuality, Dimensionality and TestSuite through submitTestCaseForm wait with no time limit, either on the deploy response or on the drawer closing.
  • Tests that deploy through the API use getAuthContext, whose timeout is 90s.
  • DataContracts and AutoPilot already have long enough test timeouts.

Evidence

Deploy latency from the CI server access log, per ingestion lane:

Run Contains #33883 deploy min / median / max
35901282191 (23 Sep) no 97 / 181 / 196 ms
35990079933 (24 Sep, first failure) yes 12.2 / 16.3 / 19.2 s
36153552168 (25 Sep) yes 15.2 / 17.2 / 60.1 s (400)

Local run against Airflow 3.3.1 with #33883's deploy.py and api/utils.py, --project=Ingestion --retries=0. Local deploy took 8.6s with only a few DAGs, so for the A/B I used page.route to delay each deploy request to CI-like latency. The delay was only in temporary spec copies, which are not part of this PR.

  • Before (current specs, deploy delayed 10s / 40s):
    • Add Column Test Case: failed with expect(locator).toHaveText … Timeout: 15000ms … element(s) not found, the same error as CI.
    • Re-deploy all test-suite ingestion pipelines: failed with Wait for every selected pipeline to report a deploy result … Timeout 30000ms exceeded.
  • After (this PR, same delays): Add Table 23.7s ✓, Add Column 23.5s ✓, Re-deploy 54.2s ✓
  • After, no delay: all 4 tests in AddTestCaseNewFlow.spec.ts and TestSuitePipelineRedeploy.spec.ts pass.

Not run: the ServiceBaseClass.scheduleIngestion change. It is only reached by the nightly ServiceIngestion specs, which need external source services. ESLint, Prettier and tsc pass on all three files.

Merge Danger

Door: two-way

Test-only change; revert is trivial.

Blast Radius: tests

Only @ingestion specs and the nightly service-ingestion helper. There are no app changes. The Re-deploy test's worst-case failure time grows from 60s to 180s.

🤖 Generated with Claude Code

Since #33883, Airflow 3's deploy call keeps the request open until the
scheduler registers the DAG (up to 60s). In CI the deploy went from about
0.1s to 15-19s, which is longer than the 15s expect that followed it.

- AddTestCaseNewFlow: createTestCase() waits for the drawer to close,
  which only happens once the deploy answers. The no-pipeline check now
  runs after that, so a late pipeline POST can no longer slip past it.
- TestSuitePipelineRedeploy: poll deploy results for 90s instead of 30s,
  and mark the test slow so the longer wait fits the test budget.
- ServiceBaseClass.scheduleIngestion: wait for the deploy response, not
  the request, before checking the success line.
Copilot AI lite review requested due to automatic review settings September 25, 2026 17:17

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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 Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 805 → 805
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/generated/entity/services/ingestionPipelines/ingestionPipeline.ts

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

Copilot AI review requested due to automatic review settings September 25, 2026 17:18

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 25, 2026 17:30

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Playwright waits for deploy completion and extends test execution timeouts.

Adds explicit waits for the blocking Airflow deploy to complete before asserting on test case pages and pipeline redeploy results. This fixes flaky Add Column Test Case and Re-deploy all test-suite ingestion pipelines tests that were timing out after deploy latency increased from ~0.1s to 15–19s in CI.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

Compact
gitar display:verbose         

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

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 43cb851664a8143caca9ed1dce870b812f14d4fb in Playwright run 36167613104, attempt 1.

✅ 4600 passed · ❌ 0 failed · 🟡 5 flaky · ⏭️ 1 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) 53m 23s

⏱️ Max setup 4m 32s · max shard execution 24m 23s · max shard-job elapsed before upload 27m 45s · reporting 37s

🌐 127.33 requests/attempt · 2.23 app boots/UI scenario · 41.63% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 41.63% (convergence target: at most 15%).
  • Application boot ratio was 2.23 per UI scenario (10938 boots / 4896 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 167 0 0 0 0 0
✅ Shard chromium-02 147 0 0 0 0 0
🟡 Shard chromium-03 197 0 2 1 0 0
✅ Shard chromium-04 176 0 0 0 0 0
🟡 Shard chromium-05 187 0 1 0 0 0
✅ Shard chromium-06 163 0 0 0 0 0
🟡 Shard chromium-07 163 0 1 0 0 0
✅ Shard chromium-08 175 0 0 0 0 0
✅ Shard chromium-09 198 0 0 0 0 0
✅ Shard chromium-10 196 0 0 0 0 0
✅ Shard chromium-11 152 0 0 0 0 0
✅ Shard chromium-12 167 0 0 0 0 0
🟡 Shard chromium-13 165 0 1 0 0 0
✅ Shard chromium-14 170 0 0 0 0 0
✅ Shard chromium-15 170 0 0 0 0 0
✅ Shard chromium-16 200 0 0 0 0 0
✅ Shard chromium-17 210 0 0 0 0 0
✅ Shard chromium-18 160 0 0 0 0 0
✅ Shard chromium-19 138 0 0 0 0 0
✅ Shard chromium-20 161 0 0 0 0 0
✅ Shard chromium-21 166 0 0 0 0 0
✅ Shard chromium-22 171 0 0 0 0 0
✅ Shard chromium-23 223 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 51 0 0 0 0 0
✅ Shard import-export-02 99 0 0 0 0 0
✅ Shard ingestion-01 46 0 0 0 0 0
✅ Shard ingestion-02 55 0 0 0 0 0
✅ Shard reindex-01 41 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 5 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryStatusFilterNestedTerms.spec.ts › expanding grandparent shows parent with any status (shard chromium-03, 1 retry)
  • Pages/Entity.spec.ts › Glossary Term Add, Update and Remove (shard chromium-03, 1 retry)
  • Features/Workflows/WorkflowOssRestrictions.spec.ts › create-workflow-button absent on OSS (shard chromium-05, 1 retry)
  • Pages/CustomProperties.spec.ts › Should verify property name is visible for mlmodel in right panel (shard chromium-07, 1 retry)
  • Features/DataProductDomainMigration.spec.ts › Data product remains visible after moving domains and deleting the original domain (shard chromium-13, 1 retry)

📦 Download artifacts

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

Merged via the queue into main with commit 5d3ed54 Sep 25, 2026
127 of 128 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/playwright-wait-for-blocking-deploy branch September 25, 2026 19:52

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.

3 participants