Skip to content

[web] flaky tests on inactive tabs: css transitions, requestAnimationFrame #53985

Open
@sigmundch

Description

@sigmundch

A few lib/html and co19 tests are testing CSS transitions, and these tests currently timeout or flake on Chrome.

See for example lib/html/transition_event_test: https://dart-current-results.web.app/#/filter=lib/html/transition_event_test

This test passes consistently in FF and Safari, but flakes on dart2js-linux-chrome nearly 90% of the time.

It appears that, like setTimeout, Chrome ignores CSS transitions on background tabs. As a simple repro, you can create a small JS program that:

  • creates an element with a css transition (like the one in transition_event_test)
  • uses setTimeout to start the transition after a delay, this gives you time to switch tabs and put it in the background before triggering the CSS transition
  • use a few additional setTimeout to log JS activity every few seconds.
  • add a listener for transitionrun, transitionstart, and transitionend events to log when they occur

What I observe is that all the JS timers complete and log data on the console, but the transition events do not trigger until after I reopen the tab and bring it in the foreground.

This leads me to believe we can't run these tests unless:

  • there a flag similar to what was recently discovered for timers that we can apply here to allow CSS transitions in background tabs
  • we make sure tabs are always active instead (e.g. open multiple windows, instead of opening multiple tabs?)

@whesse - are any of these possible?
@srujzs - should we just delete these tests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-librariesIssues impacting dart:html, etc., libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions