Skip to content
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

sensors: Try to fix flakiness in iframe-related Generic Sensor tests. #23503

Closed
wants to merge 1 commit into from

Commits on May 12, 2020

  1. sensors: Try to fix flakiness in iframe-related Generic Sensor tests.

    The second test, for focus traversal within same-origin frames, was
    occasionally failing, especially in the Mac bots.
    
    The flakiness seems to come from the way the "is_sensor_suspended" command
    was implemented in iframe_sensor_handler.html. The sensor in the iframe was
    created with the default frequency of 5Hz and, consequently, a period of
    200ms. "is_sensor_suspended" tried to detect whether the sensor was
    suspended by either receiving a new "reading" event (in which case the
    sensor was not suspended), or by reaching a timeout function with a period
    of 250ms (200ms from the sensor + a small delay).
    
    In some cases, it looks like the 250ms were not enough and we reached the
    timeout function prior to the sensor emitting a new "reading" event. Try to
    fix this by using a longer timeout of twice the sensor's period to be more
    certain that if we reach that code at least one event should have been
    emitted before.
    
    While here, make the code easier to follow by documenting what we are doing
    and relying on fewer magic numbers, and increase the sensor frequency so
    that the test does not take unnecessarily long to run.
    
    Bug: 1073865
    Change-Id: I630ad6034f0839c17f11f111ead24a88affc9dd2
    rakuco authored and chromium-wpt-export-bot committed May 12, 2020
    Configuration menu
    Copy the full SHA
    c8d0ea8 View commit details
    Browse the repository at this point in the history