Skip to content

E2E: Tolerate the insertion indicator remount in drag tests - #85270

Merged
Mamaduka merged 1 commit into
trunkfrom
fix/draggable-blocks-flaky-indicator
Oct 22, 2026
Merged

Mamaduka merged 1 commit into
trunkfrom
fix/draggable-blocks-flaky-indicator

Conversation

@Mamaduka

Copy link
Copy Markdown
Member

Fixes the flaky failures reported in #85263:

TypeError: Cannot read properties of null (reading 'y')
    at draggable-blocks.spec.js:824

The drop target computation is throttled at 200 ms, so a drag that moves in steps first shows the indicator for an intermediate pointer position and corrects it ~200 ms later. Each drop target change remounts the indicator, because BlockPopoverInbetween keys the popover by its position to stop it animating from the old one. locator.boundingBox() resolves the element and measures it in two round trips and returns null if the node detaches in between, and expect.poll calls its callback outside the try/catch that drives retries — so the null dereference fails the test instead of polling again.

The measurements now tolerate an empty box and fall back to a value that keeps the poll running instead of passing it.

Testing Instructions

Verified: draggable-blocks.spec.js 20/20 on chromium, and the multi-selection tests 64/64 at --repeat-each=8 --workers=4.

Use of AI Tools

Assisted by Claude.

Indicator is remounted on every drop target change, so boundingBox can
return null mid-poll; expect.poll rethrows instead of retrying.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Mamaduka Mamaduka self-assigned this Oct 21, 2026
@Mamaduka Mamaduka added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 9.05 MB

4079f76 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Regression: updating a specific option will only change its value and will not corrupt others in /test/e2e/specs/editor/various/core-settings.spec.js, passed after 1 failed attempt.
Error: expect(received).toStrictEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Array [
    "rewrite_rules",
-   "SERIALIZED DATA",
+   "",
  ]
    at forEach (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:46:26)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:43:35
a navigation superseded by the traversal discharges to idle in /test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts, passed after 1 failed attempt.
SyntaxError: Unexpected token 'o', "not hydrated" is not valid JSON
    at readLog (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:28:14)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:47:24
    at waitForLogLength (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:46:2)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigation-lifecycle.spec.ts:693:5
refuses the drop and uploads nothing in /test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js, passed after 1 failed attempt.
Error: expect(received).toHaveLength(expected)

Expected length: 0
Received length: 1
Received array:  [{"_links": {"about": [{"href": "http://localhost:8889/wp-json/wp/v2/types/attachment"}], "author": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/users/1"}], "collection": [{"href": "http://localhost:8889/wp-json/wp/v2/media"}], "curies": [{"href": "https://api.w.org/{rel}", "name": "wp", "templated": true}], "replies": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/comments?post=223"}], "self": [{"href": "http://localhost:8889/wp-json/wp/v2/media/223", "targetHints": {"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]}}], "wp:attached-to": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/posts/222", "id": 222, "post_type": "post"}]}, "alt_text": "", "author": 1, "caption": {"rendered": ""}, "class_list": ["post-223", "attachment", "type-attachment", "status-inherit", "hentry", "entry"], "comment_status": "open", "date": "2026-10-21T10:19:57", "date_gmt": "2026-10-21T10:19:57", "description": {"rendered": "<p class=\"attachment\"><a href='http://localhost:8889/wp-content/uploads/2026/10/44d96be7-6e09-441a-8604-9b2cc6aa3690.png'><img loading=\"lazy\" decoding=\"async\" width=\"10\" height=\"10\" src=\"http://localhost:8889/wp-content/uploads/2026/10/44d96be7-6e09-441a-8604-9b2cc6aa3690.png\" class=\"attachment-medium size-medium\" alt=\"\" style=\"width:100%;height:100%;max-width:10px;\" /></a></p>
"}, "featured_media": 0, "filename": "44d96be7-6e09-441a-8604-9b2cc6aa3690.png", "filesize": 80, "guid": {"rendered": "http://localhost:8889/wp-content/uploads/2026/10/44d96be7-6e09-441a-8604-9b2cc6aa3690.png"}, "id": 223, "link": "http://localhost:8889/?attachment_id=223", "media_details": {"file": "2026/10/44d96be7-6e09-441a-8604-9b2cc6aa3690.png", "filesize": 80, "height": 10, "image_meta": {"alt": "", "aperture": "0", "camera": "", "caption": "", "copyright": "", "created_timestamp": "0", "credit": "", "focal_length": "0", "iso": "0", "keywords": [], "orientation": "0", "shutter_speed": "0", "title": ""}, "sizes": {}, "width": 10}, "media_type": "image", "meta": [], "mime_type": "image/png", "modified": "2026-10-21T10:19:57", "modified_gmt": "2026-10-21T10:19:57", "ping_status": "closed", "post": 222, "slug": "44d96be7-6e09-441a-8604-9b2cc6aa3690", "source_url": "http://localhost:8889/wp-content/uploads/2026/10/44d96be7-6e09-441a-8604-9b2cc6aa3690.png", "status": "inherit", "template": "", "title": {"rendered": "44d96be7-6e09-441a-8604-9b2cc6aa3690"}, "type": "attachment"}]
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js:71:45

4079f76 Run

@Mamaduka
Mamaduka requested a review from jsnajdr October 21, 2026 10:09
@Mamaduka
Mamaduka merged commit 53cf37f into trunk Oct 22, 2026
89 checks passed
@Mamaduka
Mamaduka deleted the fix/draggable-blocks-flaky-indicator branch October 22, 2026 10:41
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant