Skip to content

Fix tooltip custom delay test flake - #86312

Merged
lucatume merged 1 commit into
trunkfrom
fix/typography-panel-contrast-flake
Nov 9, 2026
Merged

lucatume merged 1 commit into
trunkfrom
fix/typography-panel-contrast-flake

Conversation

@lucatume

@lucatume lucatume commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What?

Fixes the flaky Vitest Browser test tooltip/test/index.browser.test.tsx: "should respect custom delay prop when showing tooltip". Test-only change.

The typography panel contrast warning flake this PR originally also fixed was fixed on trunk by #86403.

Why?

The test failed with Test timed out in 10000ms in 41771518157.

How?

The test slept 4.2s of real time, plus waitFor and Playwright hover round-trips, within a 10s budget, so one slow browser command could exhaust it or consume the hover delay. It now follows #84113, which fixed the sibling cancellation test: park the pointer, fake setTimeout/clearTimeout, hover, and advance the clock. It asserts the tooltip is hidden at delay - 1 and visible at delay. Removed:

  • the trailing sleep( 3000 ): Ariakit's "show instantly after a hide" window is a 300ms setTimeout, and it is cleared when the anchor unmounts;
  • the hide-on-leave step: already covered by the "should show the tooltip when the tooltip anchor is hovered and hide it…" test;
  • the 10_000 timeout override.

Testing Instructions

npm run test:unit:vitest -- --project=browser packages/components/src/tooltip/test/index.browser.test.tsx

Local evidence:

  • Forced repro: adding 3s of latency before each hover makes the old test time out at 10s, while the new test passes in ~6.2s. The new test passed 30 of 30 repeats and 12 shuffled seeds of the file.
  • Mutations on showTimeout in tooltip/index.tsx all fail the new test: TOOLTIP_DELAY, delay ± 1, delay ± 300 and 0. The old test passed delay - 300 and delay ± 1.

Not verifiable locally: the natural CI stall. Without added latency, the old tooltip test never failed locally, even under CPU load. Watching trunk runs after merge confirms the fix.

Testing Instructions for Keyboard

N/A, test-only.

Use of AI Tools

Investigation, fix, mutation testing and this description by Claude Code (Claude Opus), reviewed by me.

@lucatume lucatume added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Nov 4, 2026
@lucatume lucatume self-assigned this Nov 4, 2026
@github-actions github-actions Bot added [Package] Components /packages/components [Package] Block editor /packages/block-editor labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 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: lucatume <lucatume@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
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.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

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

📦 Bundle size

Size Change: 0 B

Total Size: 8.61 MB

cf08b2b Run

@Mamaduka

Mamaduka commented Nov 6, 2026

Copy link
Copy Markdown
Member

Thanks, @lucatume!

It looks like first part of the issue was fixed in #86403.

Drive the custom delay test with a fake setTimeout clock, as #84113
did for the cancellation test, so browser command latency cannot
consume the delay or the 10s test budget.
@lucatume
lucatume force-pushed the fix/typography-panel-contrast-flake branch from 9e01bf5 to cf08b2b Compare November 9, 2026 06:44
@lucatume lucatume changed the title Fix contrast warning and tooltip delay test flakes Fix tooltip custom delay test flake Nov 9, 2026
@lucatume

lucatume commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Dropped the typography change; the PR now only fixes the tooltip delay test.

@github-actions github-actions Bot removed the [Package] Block editor /packages/block-editor label Nov 9, 2026
@lucatume
lucatume marked this pull request as ready for review November 9, 2026 06:47
@lucatume
lucatume requested a review from a team as a code owner November 9, 2026 06:47
@lucatume
lucatume requested a review from Mamaduka November 9, 2026 06:47

@mirka mirka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lucatume
lucatume merged commit 28a0e3e into trunk Nov 9, 2026
91 of 93 checks passed
@lucatume
lucatume deleted the fix/typography-panel-contrast-flake branch November 9, 2026 09:18
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [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.

3 participants