Skip to content

chore: increase HTMLText visual test wait from 250ms to 350ms#11891

Merged
Zyie merged 1 commit intodevfrom
fix/html-text-visual-test-timing
Feb 9, 2026
Merged

chore: increase HTMLText visual test wait from 250ms to 350ms#11891
Zyie merged 1 commit intodevfrom
fix/html-text-visual-test-timing

Conversation

@Zyie
Copy link
Member

@Zyie Zyie commented Feb 7, 2026

Overview

  • HTMLText visual tests use a setTimeout to wait for async texture generation (font loading, SVG-to-image, canvas conversion). The 250ms wait was insufficient for WebGPU, which has an extra canvas conversion step, causing sporadic failures.
  • Increased wait from 250ms to 350ms across all 34 HTMLText visual test scenes (38 occurrences).

Fixes

  • Sporadic WebGPU failures in HTMLText visual regression tests due to async texture generation not completing within 250ms

Chores

  • Updated all tests/visual/scenes/text-html/*.scene.ts files: setTimeout(resolve, 250) -> setTimeout(resolve, 350)
Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added

Overview

Fixes
  • Increased HTMLText visual test wait time from 250ms to 350ms to prevent sporadic WebGPU failures. WebGPU's additional canvas conversion step for async texture generation (font loading, SVG-to-image, canvas conversion) requires the extended wait time.

Fixes sporadic WebGPU failures caused by insufficient wait time
for async HTMLText texture generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Walkthrough

Increased post-render delays from 250ms to 350ms across 32+ HTML text visual test scene files in tests/visual/scenes/text-html/. Changes applied uniformly across all files. No logic, control flow, or error handling modifications. No public API or exported entity signature changes. All files show +1/-1 line changes.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title correctly starts with 'chore:' prefix, is concise and descriptive of the main change (increasing HTMLText visual test delays).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/html-text-visual-test-timing

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
tests/visual/scenes/text-html/html-text-tagged.scene.ts (1)

45-45: Consider shared constant for timeout value

Magic number 350 repeated 38× across test files. Extract to shared constant for easier future adjustments.

// e.g., in tests/visual/constants.ts
export const HTML_TEXT_RENDER_WAIT_MS = 350;
tests/visual/scenes/text-html/html-text-dynamic-destroy.scene.ts (1)

38-38: Consider extracting timeout to shared constant.

Magic number 350 duplicated across 38+ occurrences. If timing needs adjustment again, changes spread across many files.

Could define once in test utilities:

export const HTML_TEXT_RENDER_WAIT_MS = 350;

Also applies to: 69-69


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 7, 2026

commit: 0eba3a2

@Zyie Zyie changed the title fix: increase HTMLText visual test wait from 250ms to 350ms chore: increase HTMLText visual test wait from 250ms to 350ms Feb 7, 2026

renderer.render(scene);
await new Promise((resolve) => setTimeout(resolve, 250));
await new Promise((resolve) => setTimeout(resolve, 350));
Copy link
Member

Choose a reason for hiding this comment

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

As a follow up would be good to replace this Promise with built in setTimeout from node's timer/promises? Would really help simplify these waits.

@Zyie Zyie added this pull request to the merge queue Feb 9, 2026
Merged via the queue into dev with commit 8462a9a Feb 9, 2026
9 checks passed
@Zyie Zyie deleted the fix/html-text-visual-test-timing branch February 9, 2026 10:48
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.

2 participants