Skip to content

fix(playwright): free seeded Owner KPI slot in KPI Widget test (regression from #34094) - #34186

Merged
shah-harshit merged 10 commits into
mainfrom
fix-error-with-rca
Sep 30, 2026
Merged

shah-harshit merged 10 commits into
mainfrom
fix-error-with-rca

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Related to #33087

Fixes CustomizeWidgets.spec.ts › KPI Widget, which fails on Collate CI with:

TimeoutError: page.click: Timeout 60000ms exceeded.
  - waiting for locator('.ant-select-dropdown [title="Owner KPI"]')

Root cause

  • PR that caused it: test(playwright): port remaining clean specs/utils from #33088; fix TeamsPage stale-team merge #34094 (commit a64f4f4). It changed deleteKpiRequest(apiContext), which deleted every KPI on the server, into deleteKpiRequest(apiContext, ids), which deletes only the KPIs a test created. It also removed the spec's beforeAll step that deleted all existing KPIs.
  • Why it fails: The server allows only one KPI per Data Insight chart, and the Add KPI page hides charts that already have one (filterChartOptions in src/utils/KPI/KPIUtils.ts). Collate seeds static data (tools/migration_static_data/blueprint.py) that includes Migration Description KPI and Migration Owner KPI. The GET /api/v1/kpi response in the failing trace shows both. The removed purge used to delete them. Without it, the chart dropdown shows "All charts are mapped with existing KPIs." and Owner KPI never appears.
  • Why test(playwright): port remaining clean specs/utils from #33088; fix TeamsPage stale-team merge #34094's CI didn't catch it: The test did run there and passed. The full-suite run 36460477167 has chromium › Flow/CustomizeWidgets.spec.ts › KPI Widget as passed in shard chromium-17. OSS seeds no KPIs, so the owner chart slot is always free there. The failure only happens where KPIs already exist, which is Collate.

Fix

  • Free the slot: before the KPI Widget test creates its KPI, it calls a new helper, deleteSeededKpisOnChart(apiContext, 'owner') in playwright/utils/dataInsight.ts. The helper deletes only the seeded Migration … KPI on that chart. It deliberately does not bring back the old delete-everything purge. KPIs created by other specs (such as DataInsight.spec.ts) are left alone, so this test can't delete a KPI another test is still using.

Out of scope: KPI Widget (chromium) and DataInsight.spec.ts (Data Insight) share a CI lane and both create an Owner KPI, so in rare cases they can compete for the single owner chart slot. That race existed before #34094 and is not caused by this change, so the specs are not serialized here.

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.

Testing

#34094 dropped the beforeAll purge of existing KPIs. The server keeps one
KPI per chart and seeds 'Migration Owner/Description KPI', so the Add KPI
chart dropdown is empty and addKpi times out. Delete KPIs on the target
chart(s) before creating them.
@shah-harshit shah-harshit added the UI UI specific issues label Sep 29, 2026
@shah-harshit shah-harshit added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Sep 29, 2026
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Sep 29, 2026
@shah-harshit shah-harshit self-assigned this Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 9c22e180eff15b2c68aacb4166a46eb36bc91890 in Playwright run 36661789475, attempt 1.

✅ 571 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 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) 34m 58s

⏱️ Max setup 5m 4s · max shard execution 16m 25s · max shard-job elapsed before upload 19m 35s · reporting 5s

🌐 245.25 requests/attempt · 2.30 app boots/UI scenario · 13.60% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 245.25 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.3 per UI scenario (1377 boots / 599 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 144 0 0 0 0 0
✅ Shard chromium-02 137 0 0 0 0 0
✅ Shard chromium-03 132 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 ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 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

Data Insight and chromium share a CI lane with fullyParallel on, so
CustomizeWidgets' KPI Widget and DataInsight.spec could race for the single
owner-chart KPI slot. Tag KPI Widget @Data-insight and run the Data Insight
project with one worker.
Drop the Data Insight project serialization and the DataInsight.spec change.
Delete only the Collate-seeded 'Migration ...' KPI on the owner chart before
KPI Widget creates its own, so no KPI another spec creates is touched.
@shah-harshit shah-harshit changed the title fix(playwright): free KPI chart slot before creating KPIs (regression from #34094) fix(playwright): free seeded Owner KPI slot in KPI Widget test (regression from #34094) Sep 29, 2026
KPI Widget and DataInsight.spec both need the single owner-chart KPI slot and
could run concurrently in the shared chromium lane. Tag KPI Widget
@Data-insight and run the Data Insight project with one worker.
@shah-harshit

Copy link
Copy Markdown
Contributor Author

@gitar-bot the "KPI Widget can race DataInsight.spec for the one owner-chart KPI slot" finding is addressed in 31c930a, pushed just after the commit you reviewed (154c48f):

  • KPI Widget keeps { tag: '@data-insight' } (CustomizeWidgets.spec.ts:394) together with the Migration-only cleanup.
  • The Data Insight project in playwright.config.ts now runs with fullyParallel: false, workers: 1, so it and DataInsight.spec.ts never hold the owner chart slot at the same time.

playwright test --list shows KPI Widget only under Data Insight.

@gitar-bot

gitar-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

@gitar-bot the "KPI Widget can race DataInsight.spec for the one owner-chart KPI slot" finding is addressed in 31c930a, pushed just after the commit you reviewed (154c48f):

  • KPI Widget keeps { tag: '@data-insight' } (CustomizeWidgets.spec.ts:394) together with the Migration-only cleanup.
  • The Data Insight project in playwright.config.ts now runs with fullyParallel: false, workers: 1, so it and DataInsight.spec.ts never hold the owner chart slot at the same time.

playwright test --list shows KPI Widget only under Data Insight.

Confirmed, this matches the current code at HEAD (31c930a): KPI Widget carries { tag: '@data-insight' } at CustomizeWidgets.spec.ts:393-394, and the Data Insight project in playwright.config.ts (matched via grep: combineGrep(/@data-insight/)) runs with fullyParallel: false, workers: 1. That serializes it against DataInsight.spec.ts for the owner chart slot, so the race is resolved. This finding is already marked resolved.

#34056 moved Login.spec.ts to playwright/e2e/Auth/, which is a delegated path
run only by the sso-auth project. The smoke and i18n entries still named the
old path, so every PR's plan-playwright step failed with 'Playwright selectors
reference specs that do not exist'.
@shah-harshit
shah-harshit removed this pull request from the merge queue due to a manual request Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-09-29T12:07:38Z)

The entry left the queue before it was built, so no checks ran against it.

# Conflicts:
#	.github/playwright/impact-map.json
@gitar-bot

gitar-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🟡 Medium risk · The Playwright setup deletes matching seeded KPI records before creating an owner KPI.

Fixes the KPI Widget test timeout by deleting seeded KPIs before the test creates its own, addressing a regression from #34094 where the blanket KPI purge was removed. The fix uses a targeted deleteSeededKpisOnChart helper that only removes the Migration … KPI on the owner chart, leaving KPIs created by other specs intact. Also corrects the Playwright impact map to remove stale references to Pages/Login.spec.ts.

✅ 2 closed
✅ Edge Case: Chart-wide KPI purge races between DataInsight and CustomizeWidgets

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/dataInsight.ts:36-50 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeWidgets.spec.ts:397-402 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataInsight.spec.ts:64
deleteKpisOnCharts deletes every KPI on a chart, no matter who created it. .github/scripts/build_playwright_shards.py puts both the Data Insight project and chromium in the chromium lane (PROJECT_LANES), and fullyParallel is on. So DataInsight.spec.ts and CustomizeWidgets.spec.ts can run on different workers of the same shard, against one server.

This causes a race in both directions:

  • CustomizeWidgets › KPI Widget can call deleteKpisOnCharts(['owner']) after DataInsight › Create description and owner KPI has made its owner KPI. The later kpi-card checks in DataInsight then fail.
  • DataInsight's beforeAll (which runs again on retry) can delete the owner KPI that CustomizeWidgets is still asserting on.

Even with no deletes, both specs need the single owner chart slot at the same time, so the second addKpi still times out. The helper doesn't remove the conflict; it changes which spec fails. A fix needs both specs to stop needing the same slot at once: put them in one serial project/lane, or add a shared lock/test.describe.configure({ mode: 'serial' }) group. Another option is to limit the purge to seeded Migration ... KPIs and leave KPIs other specs have made.

✅ Edge Case: KPI Widget can race DataInsight.spec for the one owner-chart KPI slot

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeWidgets.spec.ts:390 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeWidgets.spec.ts:403-412
This commit takes out the @data-insight tag, so KPI Widget goes back to the fully parallel chromium project. DataInsight.spec.ts ('Create description and owner KPI', @data-insight) also creates an Owner KPI. Both projects run in the same chromium lane (PROJECT_LANES in .github/scripts/build_playwright_shards.py), so one shard can run them at the same time on different workers. The server allows only one KPI per chart, and the new cleanup only deletes KPIs whose names start with Migration. If DataInsight.spec's owner KPI exists when this test opens Add KPI, the 'Owner KPI' option is hidden and the test times out the same way as the original bug. The reverse order breaks DataInsight.spec. The commit before this one avoided that by putting the test in the serial Data Insight project. Keep the { tag: '@data-insight' } tag (with the Migration-only cleanup) so the two specs never hold the owner chart at once.

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

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 skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants