Skip to content

docs: recommend alternatives to timeouts and update reviewer checklist #53156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rajanarahul93
Copy link

Summary

This PR improves the documentation around usage of timeouts in WPT tests. It provides recommended alternatives to using setTimeout and updates the reviewer checklist to align with these practices.

Changes Made

  1. testharness-api.md:

    • Expanded the section under "Timers in Tests" to:
      • Emphasize avoiding timeouts.
      • Recommend using event-based approaches.
      • Suggest requestAnimationFrame (ideally two frames) for rendering-related delays.
      • Clarify when step_timeout() is acceptable, such as in APNG or reftest cases.
  2. checklist.md:

    • Updated the "Script Tests Only" checklist item:
      • Strengthened guidance against internal timeouts.
      • Recommends event-based testing and requestAnimationFrame as better alternatives.
      • Clarifies that timeouts (like step_timeout) should only be used when necessary.

Why

Timeouts in tests are a common source of flakiness and instability. This update addresses [Issue #20715]
by helping test authors and reviewers adopt more stable and reliable testing patterns.

Let me know if you’d like more clarification or examples added. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants