Repository navigation
fix(playwright): free seeded Owner KPI slot in KPI Widget test (regression from #34094) - #34186
Conversation
#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.
✅ Playwright Results — workflow succeededValidated commit ✅ 571 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 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) 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:
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.
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.
|
@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):
|
Confirmed, this matches the current code at HEAD (31c930a): |
#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'.
🚦 Removed from the merge queue —
|
# Conflicts: # .github/playwright/impact-map.json
Code Review ✅ Approved 2 closed / 2 findings🟡 Medium risk · The Playwright setup deletes matching seeded KPI records before creating an owner KPI. Fixes the ✅ 2 closed✅ Edge Case: Chart-wide KPI purge races between DataInsight and CustomizeWidgets
✅ Edge Case: KPI Widget can race DataInsight.spec for the one owner-chart KPI slot
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Related to #33087
Fixes
CustomizeWidgets.spec.ts › KPI Widget, which fails on Collate CI with:Root cause
deleteKpiRequest(apiContext), which deleted every KPI on the server, intodeleteKpiRequest(apiContext, ids), which deletes only the KPIs a test created. It also removed the spec'sbeforeAllstep that deleted all existing KPIs.filterChartOptionsinsrc/utils/KPI/KPIUtils.ts). Collate seeds static data (tools/migration_static_data/blueprint.py) that includesMigration Description KPIandMigration Owner KPI. TheGET /api/v1/kpiresponse 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." andOwner KPInever appears.chromium › Flow/CustomizeWidgets.spec.ts › KPI Widgetaspassedin shardchromium-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
KPI Widgettest creates its KPI, it calls a new helper,deleteSeededKpisOnChart(apiContext, 'owner')inplaywright/utils/dataInsight.ts. The helper deletes only the seededMigration …KPI on that chart. It deliberately does not bring back the old delete-everything purge. KPIs created by other specs (such asDataInsight.spec.ts) are left alone, so this test can't delete a KPI another test is still using.Out of scope:
KPI Widget(chromium) andDataInsight.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:
Checklist:
Fixes <issue-number>: <short explanation>Testing
eslint+prettieron the changed files: clean. The one ESLint warning was already there.tsc -p playwright/tsconfig.json: no errors in the changed files.