Skip to content

Fix FailureThreshold spec: reopen threshold listboxes that close before assertions - #35529

Merged
ShaileshParmar11 merged 3 commits into
mainfrom
fix/failure-threshold-listbox-flake
Oct 15, 2026
Merged

ShaileshParmar11 merged 3 commits into
mainfrom
fix/failure-threshold-listbox-flake

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the FailureThreshold.spec.ts › Enum parameters render as sentences, not raw values failure 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.toContainText check, with getByRole('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 useCloseOnScroll closes 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-content by 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 with click() and never reopened it.

This PR adds a small expectListboxOptions helper to the spec. It centres the trigger with scrollIntoViewAndSettle before opening, which removes the focus scroll. If the popover closes anyway, it reopens it and retries the option assertions inside toPass, 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:

  • Bug fix

High-level design:

N/A — single-spec test fix.

Tests:

Use cases covered

  • Operator options read as sentences with no comparison symbols, even if the popover closes after opening.
  • Threshold unit options read as sentences with no 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

  • File updated: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/FailureThreshold.spec.ts
  • ESLint and Prettier pass on the file.
  • Ran locally against a main server (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:
Spec Speed Runs Result
Original (main) normal 10 10 passed
Original (main) 6× throttled 20 3 failed, with the same two errors as CI (toBeVisible on an option, and not.toContainText → element(s) not found)
Fixed normal 10 10 passed
Fixed, trigger forced 16 px below the fold normal 10 10 passed
Fixed 6× throttled 15 15 passed
Fixed, whole spec (both tests) normal 10 × 2 20 passed
Fixed, whole spec (both tests) 6× throttled 10 × 2 20 passed

Final HTML report (40/40 passed: the whole spec ×10 at normal speed, plus a throttled copy ×10):

image

Manual testing performed

  1. Downloaded the failing trace from run 38712913438 (shard chromium-08, retry Create teams page similar to tags #1) and read the action log. The click on #testCaseFormV1_params_operator finishes 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.
  2. Confirmed in the error-context snapshot that the Operator button is [active] and that no listbox node exists.
  3. Logged capture-phase scroll, focus and aria-expanded events locally around the first Operator click. The sequence was: aria-expanded=true, then a scroll on FORM.drawer-form-content (contains the trigger), then aria-expanded=false 5 ms later. The second click opened the popover with no scroll, and it stayed open.

UI screen recording:

Not applicable — test-only change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — N/A, test fix (labelled skip-pr-checks).
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above. — N/A, test fix.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. — N/A.
  • For a UI feature or feature task: Docker recording. — N/A, test-only change.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check — N/A, no durable decision.

🤖 Generated with Claude Code

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.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 10:46
@ShaileshParmar11 ShaileshParmar11 added the skip-pr-checks Bypass PR metadata validation check label Oct 15, 2026

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 github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Oct 15, 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: 932 → 933
- 1 added, 0 removed, 13 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/observability/data-quality/ThresholdPreview/ThresholdPreview.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/constant/config.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/Utils/appMode.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/codeEditor.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/dataQuality.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/testCases.ts
  openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx
  openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/RunDetailsCard/RunDetailsCard.tsx
  … and 3 more

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 balanced review requested due to automatic review settings October 15, 2026 10:47

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.

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.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 11:51

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 Oct 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Reopening threshold listboxes and retrying assertions could let intermittent popover failures pass, reducing detection of UI instability.

Adds an expectListboxOptions helper to FailureThreshold.spec.ts that reopens the Operator and Threshold listboxes when they close after opening, then retries the option assertions inside toPass. The assertions themselves are unchanged. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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 Oct 15, 2026
Merged via the queue into main with commit 2e7eb06 Oct 15, 2026
77 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the fix/failure-threshold-listbox-flake branch October 15, 2026 13:19
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.

4 participants