Skip to content

test(e2e): keep row B clear of the search dock before 17b's right-click - #18644

Merged
iamwhatever merged 1 commit into
mainfrom
fix/e2e-17b-right-click-race
Oct 9, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/e2e-17b-right-click-race

Conversation

@CrysisDeu

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The E2E spec session-tags-e2e.spec.ts › 17b passes on its first attempt every time, so CI stops going red on PRs that never touched it.

17b is the number one cause of red CI in this repo: 75 of the last 300 CI runs end with 1 spec(s) passed only on a retry, ceiling is 0: session-tags-e2e.spec.ts > E2E: sidebar tag columns > 17b…, and 5 more hard-fail on it, across 21 branches (#17941). The failing attempt stops at expect(menu).toBeVisible(): the picker closed, __ctx is true, no context menu opened, focus is on body.

Why it matters

Every PR pays for it: an unrelated change goes red, someone reruns the job, the flake ledger grows. Because the retry passes, nobody saw what the browser saw.

Not a goal

  • No product change. The app's behaviour is correct and unchanged: the picker's backdrop forwards a right-click to what is beneath it, and rows slide under the floating search dock when the lane scrolls.
  • No retries, no toPass, no MAX_FLAKY_SPECS change.
  • Not the trace-retention and flaky-gesture annotation tooling of test(e2e): keep a trace on 17b's first failure, wait for row B #18529.

What changed (motivation → approach → change)

The cause was read from the trace #18529 captured in run 37991140068: a hit test at the recorded click point in its DOM snapshots.

Step What happens on a slow runner
rowA.click({ button: 'right' }) The rows' enter animation is still running: Playwright logs element is not stable three times
Fourth click attempt Playwright forces scrollIntoView({ block: 'start' }) on row A (its retry ladder: none → end → center → start)
Lane scroll-padding-top = 44 px (the dock's height) Row A parks just below the dock at y=129. Row B, the row above A, lands at y=81: under the glass search field (y 93–125)
Right-click at (box.x + 24, box.y + box.height / 2) = (269, 105) The element beneath the backdrop is the search input, not row B
Backdrop forwards the contextmenu there Picker closes, native menu suppressed, no row menu: the exact failure

Why it flakes: how many "not stable" retries happen depends on the runner's speed. 0, 1 or 2 retries leave B visible (no scroll, A at the end, A centred). Exactly 3 puts B under the dock. Timing is consistent within one browser context, which is why every in-context reload in that run missed and only the new-worker retry passed.

The fix: before reading row B's box, the spec runs rowB.scrollIntoView({ block: 'nearest', behavior: 'instant' }). Chromium honours the lane's scroll-padding, so this is a no-op when B is already clear of the dock and brings B out from under it otherwise. One precondition is added next to the existing "not on the dialog" check: the element beneath the backdrop at the click point must be inside row B (the same walk elementBeneath in SlotTagPopover does). A future dock, toast or overlay at that point then fails by name instead of as a missing menu.

Backwards compatibility

Compatible: one Playwright spec changes; no product code.

Removes nothing: no test or assertion is deleted.

Tests

  • website/playwright/session-tags-e2e.spec.ts › 17b: the new precondition pins that the forwarded right-click can reach row B's trigger before the gesture is sent.

Manual verification

  • CI trace from run 37991140068 (artifact e2e-playwright-failures) replayed in the trace viewer: elementsFromPoint(269, 105.1) under the backdrop → input / [data-testid=search-field-glass], then row B; lane scrollTop 138 and scroll-padding-top 44.14 px in all 20 snapshots; the row A click logged retrying click action three times in all six in-context attempts.
  • Local reproduction against a fresh harness gateway with 25 seeded rows and rowA.scrollIntoView({ block: 'start' }) before the click (standing in for Playwright's fourth attempt): the unfixed spec fails 2/2 with expect(menu).toBeVisible → element(s) not found, same geometry as CI (A y=129, B y=81). The fixed spec passes 5/5 under the same forced geometry (B moves to y=129, hit test lands in row B).
  • Fixed spec, normal geometry: --repeat-each 30 --retries 0 → 30/30 pass.

Screenshots / video

N/A — Playwright spec only; no UI changes.

Related Issues

Fixes #17941. Overlaps #18529, whose stable-box wait on row B does not help here: B is stably under the dock.

Pattern harvest

Rule candidate: review-prompt
Pattern: a Playwright spec that drives page.mouse from a boundingBox() must hit-test that point (elementsFromPoint) first; an earlier locator click may have scrolled the container through Playwright's retry ladder (block: 'end' | 'center' | 'start'), and a floating or sticky overlay can cover the measured box.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 482845d1664dcf542b00df97f3b3c8086e37dd2c ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 482845d1664dcf542b00df97f3b3c8086e37dd2c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 482845d

Description read

[DESCRIPTION-READ] ec3ba856561b1e07ff17d40d9c473f976f0eb20b9c2a472a58245287cc4ac18a

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 482845d1664dcf542b00df97f3b3c8086e37dd2c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] 482845d

Description read

[DESCRIPTION-READ] bc3d1a2620988b676a16b62f726aeef12fd782fe8fc31401dd74f3561ba250d4

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 482845d1664dcf542b00df97f3b3c8086e37dd2c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 482845d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 482845d1664dcf542b00df97f3b3c8086e37dd2c: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 482845d1664dcf542b00df97f3b3c8086e37dd2c — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 482845d

Verdict parsed from the review's SHA-scoped output markers for commit 482845d1664dcf542b00df97f3b3c8086e37dd2c.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 482845d1664dcf542b00df97f3b3c8086e37dd2c: <one-sentence reason>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 9, 2026
@iamwhatever
iamwhatever merged commit abec9ca into main Oct 9, 2026
101 checks passed
@iamwhatever
iamwhatever deleted the fix/e2e-17b-right-click-race branch October 9, 2026 23:43
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: session-tags-e2e.spec.ts 17b right-click on another row passes only on a retry in E2E (stub ACP backend, offline)

2 participants