Repository navigation
Fix FailureThreshold spec: reopen threshold listboxes that close before assertions - #35529
Conversation
The Operator and Threshold unit options in FailureThreshold.spec.ts were asserted after a single click. The react-aria popover closes on any scroll around its trigger, so it could vanish right after opening and the option checks timed out on a missing listbox. Reopen it and retry the assertions until they hold on one open popover.
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated 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 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 |
Opening the popover focuses its trigger. When the trigger sits partly below the drawer form's visible edge, the form scrolls to reveal it and react-aria closes the popover on that scroll.
Code Review ✅ Approved🟡 Medium risk · Reopening threshold listboxes and retrying assertions could let intermittent popover failures pass, reducing detection of UI instability. Adds an VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. 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:
Fixes the
FailureThreshold.spec.ts › Enum parameters render as sentences, not raw valuesfailure in the merge queue (added in #35486).It failed in two queue runs today (38712913438, 38712917017). The trace shows the Operator listbox opening and its first option ("at most") becoming visible. About 30 ms later the listbox is gone, so the next option check times out after 15 s. The first attempt failed the same way at the
not.toContainTextcheck, withgetByRole('listbox')not found. The page snapshot at the failure shows the Operator button still focused and no popover.Root cause (reproduced locally). The options live in a non-modal react-aria popover, and
useCloseOnScrollcloses it on any scroll of a container around its trigger. After the SQL is typed, the Operator trigger sits about 16 px below the visible bottom edge of the drawer form (trigger bottom 571 px, form height 555 px). Opening the popover moves focus back to the trigger, so the browser scrolls.drawer-form-contentby those 16 px (scrollTop 327 → 343) to reveal it. React-aria sees that scroll and closes the popover about 5 ms after it opened. A second open does not trigger a scroll, because the trigger is already fully visible, so it stays open. The spec opened the popover once withclick()and never reopened it.This PR adds a small
expectListboxOptionshelper to the spec. It centres the trigger withscrollIntoViewAndSettlebefore opening, which removes the focus scroll. If the popover closes anyway, it reopens it and retries the option assertions insidetoPass, using 2 s inner timeouts so the reopen happens quickly. The Operator and Threshold unit steps both use it. The assertions themselves are unchanged.Type of change:
High-level design:
N/A — single-spec test fix.
Tests:
Use cases covered
ABSOLUTE/PERCENTAGE, under the same condition.Unit tests
Not applicable — Playwright spec change only.
Backend integration tests
Not applicable (no backend changes).
Ingestion integration tests
Not applicable (no ingestion changes).
Playwright (UI) tests
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/FailureThreshold.spec.tsmainserver (8fa2b760b06), Chromium,PLAYWRIGHT_IS_OSS=true,--retries=0, 1 worker. A 6× CPU throttle via CDP (Emulation.setCPUThrottlingRate) stands in for a slow CI runner:main)main)toBeVisibleon an option, andnot.toContainText→element(s) not found)Final HTML report (40/40 passed: the whole spec ×10 at normal speed, plus a throttled copy ×10):
Manual testing performed
#testCaseFormV1_params_operatorfinishes at t=219336. The "at most" option resolves at t=219427. "fewer than" then waits the full 15 s for a listbox that no longer exists.[active]and that nolistboxnode exists.scroll, focus andaria-expandedevents locally around the first Operator click. The sequence was:aria-expanded=true, then ascrollonFORM.drawer-form-content(contains the trigger), thenaria-expanded=false5 ms later. The second click opened the popover with no scroll, and it stayed open.UI screen recording:
Not applicable — test-only change.
Checklist:
Fixes <issue-number>: <short explanation>— N/A, test fix (labelledskip-pr-checks).Fixes #<issue-number>above. — N/A, test fix.🤖 Generated with Claude Code