Closed Bug 1922353 Opened 1 year ago Closed 1 year ago

Increase animation duration in WPT animation-display-lock.html to make it more robust

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

Per bug 1895554 comment 21 and the test failure annotation:

  • WPT animation-display-lock.html (wpt.fyi, wpt.live) intermittently fails on slowish platforms like TSAN and ASAN.
  • The test has a hardcoded 1-second-long animation and transition, and the test manually advance the animation timeline (by setting .currentTime); BUT, I'm pretty sure those animations can also just repeat/complete on their own before we advance currentTime (e.g. inside of calls like await waitForAnimationFrames(1);)
  • ...and I think that's essentially what's happening when we experience a test-timeout.
  • I can reproduce similar test-timeouts on Chrome and Firefox if I reduce the animation durations to be 0.1s (which makes the animations more-readily complete on-their-own, without currentTime advancing, even in release builds).
  • So: these timeouts aren't a browser bug; they're just a hazard baked into the test that browsers can trip over if the 1s test-duration is too short relative to how long other things are taking to complete.
  • ...and we can avoid the timeouts if we simply increase the animation durations (and the associated currentTime values in the test, etc.)

I've got a patch on Try that makes this change and removes the test-failure annotation:
https://treeherder.mozilla.org/jobs?repo=try&revision=7de30cf2d1ed8c7cbf905b6385c53f83a363871a

Hoping that it passes...

Before this change, some pieces of this test intermittently timed out or failed
to run, in the more-heavyweight Firefox configurations (e.g. TSAN/ASAN,
particularly with debugging enabled). These failures seem to be because the
animation/transition durations in this test were too short, such that the
animation/transition occasionally complete on their own before the test is
ready for them to complete (i.e. before the test explicitly advances to the end
of an animation by programmatically setting 'currentTime').

I can reproduce similar failures in release Firefox and Chrome builds if I
simply reduce the animation/transition durations (from 1s to 0.1s), so I think
these failures are an indication of a race condition in the test logic (a
fragile dependency on the animation taking "long enough" that it won't complete
on its own), rather than a browser bug.

This patch attempts to avoid these intermittent failures by increasing the
animation durations by 10x, so that they're much less likely to complete on
their own. Note that the standard WPT test-timeout is 10s, so it's reasonable
to expect that the test shouldn't take longer than that (and hence we won't
accidentally let these animations play to completion before the test logic has
a chance to advance them).

This patch also updates the logic/expectations to account for the new
duration. e.g. we now set currentTime to 19999 (19.999s) rather than 1.999
(1.99s), to advance to just before the end of the second repetition of our
animation. And this means we'll be slightly further through the animation, so
the test's assertions now expect an opacity of 0.9999 rather than just 0.999.

(In reply to Daniel Holbert [:dholbert] from comment #0)

I've got a patch on Try that makes this change and removes the test-failure annotation:
https://treeherder.mozilla.org/jobs?repo=try&revision=7de30cf2d1ed8c7cbf905b6385c53f83a363871a

Hoping that it passes...

Try looks green, hooray!

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/438cafb13880 Use longer animation durations in animation-display-lock.html to avoid intermittent failures on slow configurations. r=boris
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/48437 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: