Chore(UI): Ensure the runner selection to avoid flaky behaviour - #31541
Conversation
❌ 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 |
| const runnerOption = page.getByRole('option').getByText(runnerDisplayName); | ||
| await runnerOption.waitFor({ state: 'visible' }); | ||
| await runnerOption.click(); |
There was a problem hiding this comment.
💡 Edge Case: Removed .first() may trigger Playwright strict-mode violation
The old code used page.getByRole('option', { name: /Collate SaaS/i }).first(), while the new util uses page.getByRole('option').getByText(runnerDisplayName) without .first(). getByText matches by substring/case-insensitively by default, so if more than one option contains the runner display name the locator resolves to multiple elements and waitFor/click throws a strict-mode violation, reintroducing the flakiness this PR aims to remove. Append .first() (e.g. page.getByRole('option', { name: runnerDisplayName, exact: true }).first()) to keep the selection deterministic.
Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsIntroduces a reusable runner selection utility to prevent flaky Playwright tests and adds BigQuery authentication overrides. Consider restoring .first() to prevent strict-mode violations when locating service form elements. 💡 Edge Case: Removed .first() may trigger Playwright strict-mode violation📄 openmetadata-ui/src/main/resources/ui/playwright/utils/serviceFormUtils.ts:94-96 The old code used 🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 562 passed · ❌ 0 failed · 🟡 1 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) 52m 34s ⏱️ Max setup 3m 37s · max shard execution 17m 46s · max shard-job elapsed before upload 21m 44s · reporting 4s 🌐 211.13 requests/attempt · 2.82 app boots/UI scenario · 4.69% 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 |
This pull request improves the Playwright test codebase by introducing a reusable utility for selecting the ingestion runner in service forms and updating tests to use this utility. It also adds support for authentication overrides in the BigQuery ingestion class. These changes enhance maintainability, reduce code duplication, and provide more flexibility for test configuration.
Test utility improvements:
COLLATE_SAAS_RUNNERtoserviceForm.tsfor consistent reference to the runner display name.selectIngestionRunnerFromDropdownfunction inserviceFormUtils.tsto standardize the selection of the ingestion runner in forms, replacing duplicated logic in multiple tests. [1] [2]Test refactoring and usage:
ServiceForm.spec.ts,ApiServiceRest.spec.ts,ConnectionConfigLayout.spec.ts) to use the new utility and constant when selecting the ingestion runner, improving code clarity and reducing duplication. [1] [2] [3] [4] [5] [6] [7]BigQuery ingestion enhancements:
authOverridesproperty toBigQueryIngestionClass, allowing test cases to override authentication parameters (such asprivateKey) for greater flexibility in test configuration. [1] [2] [3]