You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: hover the grab target before clicking in the split grab e2e - #39868
Fixes a flaky e2e test: browser-split-grab-shortcut › "escape typed in the page exits grab, the copy toast and find".
Cause
The test sent mouseMove, mouseDown and mouseUp to the guest back to back. Two things make that racy:
The "Click or hover an element" banner appears while the picker is still arming, before the guest sets __orcaGrab.onPick.
The overlay records the hovered element in a requestAnimationFrame after mousemove. When the click arrives before that frame, getCurrentElement() is null, the pick resolves as cancelled, grab ends, and no "Copied" toast appears.
Fix
Hover like a user does. Wait for the guest picker to accept a pick, move the mouse, wait until the picker has a hovered element, then click. Only the test changes.
Evidence
Pinned to 2 cores (taskset -c 0,1), --repeat-each=20: before the fix it failed 3/20, and 6–7/20 in another build of the renderer. After the fix: 20/20 passes in both.
Instrumented runs showed the failing pick resolving cancelled with reason user at the moment of the click, with no navigation and no renderer-side cancel.
No actionable comments were generated in the recent review.
Walkthrough
The test adds helpers to read grab state in the guest webview and to wait for the picker to arm and detect the hovered element after a mouse-move event. The Escape/copy-toast test uses the hover helper. Its click events remain inline.
Merge Risk: Minimal · up to 93dfd
The change coordinates the test’s hover and click; no merge-blocking risk is established.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title names the primary change: the split grab e2e test now hovers the grab target before clicking. The title is short and specific, and it matches the raw summary, the objectives, and the descrip…
Description check
The description covers the core template sections that apply to this test-only fix. It explains the cause of the race, the fix, and the evidence from repeated runs. It states the change is test-only. …
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the primary change: the split grab e2e test now hovers the grab target before clicking. The title is short and specific, and it matches the raw summary, the objectives, and the description. The 'test:' prefix matches the test-only scope of the change.
Full details: Description check
Explanation
The description covers the core template sections that apply to this test-only fix. It explains the cause of the race, the fix, and the evidence from repeated runs. It states the change is test-only. It does not fill in the ELI5, Linked Issue (the template requires 'Fixes #' with an issue number), Visual Proof (N/A is expected with a reason), Risk level, Testing checklist, or Review and Checklist sections. Because the change is small and the core rationale is present, the description is mostly complete.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 77f838a7-8631-4b90-8512-40eea3d50d66
Commits
Reviewing files that changed from the base of the PR and between d464685 and 93dfdda.
Files selected for processing: 1
tests/e2e/browser-split-grab-shortcut.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a flaky e2e test:
browser-split-grab-shortcut› "escape typed in the page exits grab, the copy toast and find".Cause
The test sent
mouseMove,mouseDownandmouseUpto the guest back to back. Two things make that racy:__orcaGrab.onPick.requestAnimationFrameaftermousemove. When the click arrives before that frame,getCurrentElement()is null, the pick resolves ascancelled, grab ends, and no "Copied" toast appears.Fix
Hover like a user does. Wait for the guest picker to accept a pick, move the mouse, wait until the picker has a hovered element, then click. Only the test changes.
Evidence
taskset -c 0,1),--repeat-each=20: before the fix it failed 3/20, and 6–7/20 in another build of the renderer. After the fix: 20/20 passes in both.cancelledwith reasonuserat the moment of the click, with no navigation and no renderer-side cancel.