Repository navigation
fix(playwright): stop PersonaAIContext entity-type picks hanging when the popover closes - #34119
Conversation
… 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
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…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.
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. 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 |
✅ Playwright Results — workflow succeededValidated commit ✅ 75 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) 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:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
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.
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.selectOptionWithRetry(inutils/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:
rules/previewresponse lands, and the "Article" option goes from "not stable" to "detached from the DOM".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-eachand--retries=0.element was detached from the DOM, retryingon the "Article" click). The run took 3.0 min.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