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: Stop using "reading" events to check if a sensor is suspended. #25534

Merged
merged 1 commit into from Sep 16, 2020

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 15, 2020

Tests using generic-sensor-iframe-tests.sub.js have been flaky on the
Mac bots for a long time. The flakiness is usually seen in the
same-origin iframe focus traversal test, where the "is_sensor_suspended"
command returns true rather than false.

The cause is the same one as r805674 ("sensors: Rewrite the frequency
hint test"): the mock platform sensor uses window.setInterval() to
simulate the periodic reading of sensor data, but setInterval()'s actual
frequency can vary a lot (especially on the Mac bots), to the point that
we cannot rely on the other timer we created in
iframe_sensor_handler.html will consistently have a period longer than
setInterval()'s.

The only way to reliably check if a sensor is suspended or not is to
query the mock platform sensor directly at the expense of no longer
using only the public API: we now have a isReadingData() method in
MockSensor that we use to query if the sensor is fetching new readings
or not.

Bug: 1073865
Change-Id: I99941b88722fc68163cca54e44ac6fc61a6425cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411933
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807421}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2411933 branch from 0366489 to f2895bc Sep 16, 2020
Tests using generic-sensor-iframe-tests.sub.js have been flaky on the
Mac bots for a long time. The flakiness is usually seen in the
same-origin iframe focus traversal test, where the "is_sensor_suspended"
command returns true rather than false.

The cause is the same one as r805674 ("sensors: Rewrite the frequency
hint test"): the mock platform sensor uses window.setInterval() to
simulate the periodic reading of sensor data, but setInterval()'s actual
frequency can vary a lot (especially on the Mac bots), to the point that
we cannot rely on the other timer we created in
iframe_sensor_handler.html will consistently have a period longer than
setInterval()'s.

The only way to reliably check if a sensor is suspended or not is to
query the mock platform sensor directly at the expense of no longer
using only the public API: we now have a isReadingData() method in
MockSensor that we use to query if the sensor is fetching new readings
or not.

Bug: 1073865
Change-Id: I99941b88722fc68163cca54e44ac6fc61a6425cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411933
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807421}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2411933 branch from f2895bc to 841e484 Sep 16, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 394d898 into master Sep 16, 2020
27 checks passed
27 checks passed
build-and-publish
Details
Azure Pipelines Build #20200916.43 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
Azure Pipelines (infrastructure/ tests: macOS) infrastructure/ tests: macOS succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
download-firefox-nightly Community-TC (pull_request)
Details
infrastructure/ tests Community-TC (pull_request)
Details
infrastructure/ tests (Python 3) Community-TC (pull_request)
Details
lint Community-TC (pull_request)
Details
resources/ tests Community-TC (pull_request)
Details
sink-task Community-TC (pull_request)
Details
staging.wpt.fyi - chrome[experimental] Chrome results
Details
staging.wpt.fyi - firefox[experimental] Firefox results
Details
staging.wpt.fyi - safari[experimental] Safari results
Details
wpt-chrome-dev-results Community-TC (pull_request)
Details
wpt-chrome-dev-results-without-changes Community-TC (pull_request)
Details
wpt-chrome-dev-stability Community-TC (pull_request)
Details
wpt-decision-task Community-TC (pull_request)
Details
wpt-firefox-nightly-results Community-TC (pull_request)
Details
wpt-firefox-nightly-results-without-changes Community-TC (pull_request)
Details
wpt-firefox-nightly-stability Community-TC (pull_request)
Details
wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-2411933 branch Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.