web-platform-tests / web-platform-tests/wpt

Flaky tests due to lack of `class="reftest-wait"` in tests using `requestAnimationFrame` etc.

Open
#39,286 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

infra lint priority:backlog wptrunner
Dominant language
HTML
Stars
6.2k
Forks
3.9k
Avg merge
1d 6h
Merged PRs (30d)
586

Description

I found some tests are flaky due to lack of class="reftest-wait" on the document element, while the test uses requestAnimationFrame() etc. Some tests even use <script src="/common/reftest-wait.js"> assuming the script will add and remove reftest-wait.

Two examples:
https://github.com/web-platform-tests/wpt/blob/master/svg/styling/invalidation/nth-child-of-class.svg
https://github.com/web-platform-tests/wpt/blob/master/css/css-position/fixed-z-index-blend-ref.html

Some thoughts:

  1. How about letting reftest-wait.js automatically add class="reftest-wait"?
  2. A validation rule checking for some wrong pattern may be helpful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the behavior of /common/reftest-wait.js and the two cited tests: svg/styling/invalidation/nth-child-of-class.svg and css/css-position/fixed-z-index-blend-ref.html. Determine how requestAnimationFrame() tests signal readiness, then define and validate a consistent fix for the flaky pattern; done means the affected tests no longer race and the proposed validation is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
testing, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.