Skip to content

Make the markdown-shortcuts and shadow-dom editing tests deterministic - #6205

Merged
dylans merged 1 commit into
mainfrom
deflake-markdown-shadow
Oct 10, 2026
Merged

dylans merged 1 commit into
mainfrom
deflake-markdown-shadow

Conversation

@dylans

@dylans dylans commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Test-only. Fixes two integration tests that flake locally and keep showing up as "known failure on main" in PR notes.

Both tests clicked the editor and then immediately drove the selection with keys: Home (or Cmd+Left), or Cmd/Ctrl+A. Slate reads a click's selection through a 100 ms throttle, so under load the click was sometimes applied after the keys and moved the caret back to where the mouse landed. Typing then went mid-line: * no longer made a list, and Hello, Playwright! landed inside the existing text.

  • markdown-shortcuts › can add list items: focuses the editor without a mouse position, selects the document start through the editor, and waits for the DOM caret before typing.
  • shadow-dom › renders slate editor inside nested shadow and edits content: uses the shared clearEditor helper instead of a keyboard select-all.
main this PR
shadow-dom, Chromium alone, ×10 4 failed 0 failed
markdown-shortcuts, under parallel load failed in about half of local full-suite runs 160 of 160 passed across all 4 projects, 8 workers, ×20

The full suite passes locally (263 passed, 0 failed), as do the strict checks on Node 24. No changeset, since only tests change.

A programmatic editor.select made within 100 ms of a click can be overridden when the throttled click is processed. That's real but hard for a user to hit, so it's left alone here.

Both tests clicked the editor and then immediately drove the selection
with keys: Home (or Cmd+Left), or Cmd/Ctrl+A. Slate reads a click's
selection through a 100 ms throttle, so under load the click was
sometimes applied after the keys and put the caret back where the mouse
landed. Typing then went mid-line: "* " no longer made a list, and
"Hello, Playwright!" landed inside the existing text.

markdown-shortcuts now focuses the editor without a mouse position and
selects the document start through the editor. shadow-dom uses the
shared clearEditor helper instead of a keyboard select-all.

On main the shadow-dom test failed 4 of 10 runs alone in Chromium, and
markdown-shortcuts failed under parallel load. Both now pass 160 of 160
across all four projects with 8 workers.
@changeset-bot

changeset-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ffaa518

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant