test(charts): fix flaky ORDER BY chart e2e by dismissing autocomplete#2639
test(charts): fix flaky ORDER BY chart e2e by dismissing autocomplete#2639jordan-simonovski wants to merge 2 commits into
Conversation
The "custom ORDER BY on a categorical bar chart" e2e test intermittently failed with `locator.click: Timeout 20000ms` on the ORDER BY editor (ChartEditorComponent.setOrderBy). Root cause: setGroupBy types into the "SQL Columns" CodeMirror editor but never dismisses the autocomplete dropdown, unlike setOrderBy which presses Escape. The lingering group-by autocomplete overlays the ORDER BY editor, so the subsequent click fails Playwright's actionability check until it times out; on retry the timing differs and it passes — a classic flake. - setGroupBy now dismisses its autocomplete (Escape), mirroring setOrderBy. - setOrderBy defensively dismisses any lingering popup before clicking, so the failing call site is robust regardless of the preceding interaction. Test-only change; no changeset (no user-facing package impact).
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Greptile SummaryThis PR stabilizes chart editor end-to-end tests by dismissing autocomplete overlays.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into jordansimonovsk..." | Re-trigger Greptile |
Deep ReviewTest-only change to a shared Playwright page object ( ✅ No critical issues found. 🟡 P2 -- recommended
🔵 P3 nitpicks (1)
Reviewers (8): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, agent-native, learnings-researcher. Testing gaps:
|
E2E Test Results✅ All tests passed • 118 passed • 2 skipped • 714s
Tests ran across 4 shards in parallel. |
Why
The
should apply a custom ORDER BY on a categorical bar charte2e test (chart-explorer.spec.ts) is intermittently failing in CI with:Root cause:
setGroupBytypes into the "SQL Columns" CodeMirror editor but never dismisses the resulting autocomplete dropdown, whereassetOrderBypressesEscapeat the end. In the failing sequencesetChartType(Bar) → setGroupBy('ServiceName') → setOrderBy(...), the group-by autocomplete popup is still open and overlays the ORDER BY editor. Playwright'sclick()then waits on actionability (element must receive pointer events) and times out after 20s. On retry the timing differs and it passes — a classic overlay/timing flake.What
setGroupBynow dismisses its autocomplete withEscapeafter typing, mirroring the convention already used insetOrderBy.setOrderBydefensively dismisses any lingering popup before its click, so the exact failing call site is robust regardless of the preceding interaction.Both are one-line additions that match existing patterns in the same file.
Notes
prettier --checkandeslintpass on the changed file. The full e2e wasn't run locally (the flake is intermittent and needs the seeded full stack); the fix is grounded in the CI call log + thesetGroupBy/setOrderByasymmetry.