Skip to content

fix(playwright): stop PersonaAIContext entity-type picks hanging when the popover closes - #34119

Merged
ShaileshParmar11 merged 2 commits into
mainfrom
ShaileshParmar11/persona-context-picker-flake
Sep 28, 2026
Merged

ShaileshParmar11 merged 2 commits into
mainfrom
ShaileshParmar11/persona-context-picker-flake

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This fixes a timeout in Features/PersonaAIContext.spec.ts › configures every entity type, behavior, section, filter, and setting. It failed 4 of 4 times in run 36383463150 (both attempts, first try and retry), on #34031, a PR that doesn't touch this page.

delete-condition-button.click()      # starts a debounced rules/preview refresh
entitySelect.click()                 # trigger is out of view (drawer scrolled to the bottom earlier): click() scrolls the drawer
  popover opens
  next frame: scroll event and preview re-render → React Aria closes the popover
listbox › "Article".click()          # "not stable", then "detached from the DOM"; no timeout, waits until the test times out
-    await entitySelect.click();
-    await entityTypePopup.getByText('Article', { exact: true }).click();
+    await selectOptionWithRetry(
+      entitySelect.getByRole('button'),
+      entityTypePopup.getByText('Article', { exact: true })
+    );

selectOptionWithRetry (in utils/common.ts) is the shared helper for this race, and the spec already imports it. It scrolls the trigger into view and waits for it to settle before opening. If a late close still happens, it reopens the popover with a short option timeout instead of hanging. All 5 entity-type picks in the test now use it.

Fixes #34118

Evidence

The CI trace:

  • At 270.2s the test deletes a condition. At 270.6s it clicks the entity-type trigger.
  • At 270.8s the mocked rules/preview response lands, and the "Article" option goes from "not stable" to "detached from the DOM".
  • After that, only waiting for getByRole('listbox').getByText('Article') is logged, until the timeout.

Local repro: I temporarily injected Emulation.setCPUThrottlingRate(6) into the test (not committed), with --repeat-each and --retries=0.

  • Before: 1 of 4 runs failed with the CI signature (element was detached from the DOM, retrying on the "Article" click). The run took 3.0 min.
  • After: 6 of 6 runs passed in 50s.
  • Full spec, unthrottled: 29 of 29 passed.

Merge Danger

Door: two-way

Test-only change.

Blast Radius: tests

It only changes playwright/e2e/Features/PersonaAIContext.spec.ts. There are no app changes.

🤖 Generated with Claude Code

… the popover closes

React Aria closes a popover when an ancestor of its trigger scrolls. The rule
drawer is scrolled to the bottom earlier in the test, so click() scrolls the
entity-type trigger back into view a frame after the popover opens, and a
debounced preview re-render can land at the same moment. The option then
detached and the click waited until the test timed out.

Pick entity types through selectEntityType, which scrolls the trigger into
view first and retries open-and-pick with a short option timeout.

Fixes #34118
Copilot AI lite review requested due to automatic review settings September 28, 2026 09:17

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 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 28, 2026
…tOptionWithRetry

utils/common already has the scroll-settle-and-retry helper for React Aria
pickers, and this spec already imports it; drop the local copy.
Copilot AI review requested due to automatic review settings September 28, 2026 09:25

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 Sep 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk · One Playwright spec replaces direct picks with retry-based selection.

Fixes a timeout in the PersonaAIContext entity-type picker test by scrolling the trigger into view before opening the popover and retrying the selection if the popover closes prematurely due to concurrent re-renders. Test-only change with no app impact; all 5 entity-type picks in the spec now use the stabilized helper. No issues found.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 78a5835755ff03ba117f8426a820bd3265af84fb in Playwright run 36403420845, attempt 1.

✅ 75 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) 19m 0s

⏱️ Max setup 2m 53s · max shard execution 9m 4s · max shard-job elapsed before upload 12m 17s · reporting 3s

🌐 122.79 requests/attempt · 1.54 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 1.54 per UI scenario (117 boots / 76 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 75 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

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 451b972 Sep 28, 2026
96 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/persona-context-picker-flake branch September 28, 2026 11:45
ShaileshParmar11 added a commit that referenced this pull request Nov 23, 2026
Fixes the four flaky tests in the 2.0 nightly #199 Playwright runs:

- LargeGlossaryPerformance drag and drop: wait for both rows to stop moving
  before dragTo (waitForStableBox, from main 7860a3f / #32631).
- MetricBulkImportExportEdit async export: accept an auto-opened tray and
  retry the launcher click (clickUntilVisible, from main 31835ec / #34914).
- PersonaAIContext entity-type picks: retry through the expanded trigger
  (selectOptionWithRetry, from main 451b972 / #34119 and 320f44b / #37423).
- TableConstraint composite tooltip: scope the tooltip locator by name so a
  leftover tooltip cannot make the role match ambiguous.

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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky PersonaAIContext spec: entity-type popover closes on click-time scroll

3 participants