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

WebXR: refactor session shutdown handling #20051

Merged
merged 1 commit into from Nov 5, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 1, 2019

While investigating a flaky test, one of the issues found was that a session
'end' event is triggered directly after issuing the session.end() call, without
waiting for device-side session teardown to proceed. As a result, requesting a
new session could fail due to the device side thinking there's already an
active immersive session.

According to https://immersive-web.github.io/webxr/#ended and discussions with
Brandon, expected behavior is that the 'end' event and end().then promise
resolution should be delayed if needed to ensure that a new session can
be started at that time.

This CL adds a "ended but not yet shut down" state to XRSession, and adds
a new ShutdownSession call to isolated_xr_service's XRRuntime, to enable
the expected delay. In case of mojo communication errors, the shutdown
happens immediately.

Also update WebXrTestFramework's enterSessionWithUserGesture to detect
and retry clicks that aren't delivered after session end transitions, and
remove sleeps that were previously added to work around flakiness in WebXR
VR consent tests. It appears that this flakiness was at least in part caused
by prematurely starting a new session while the previous session wasn't
fully shut down yet. The test change is included in the same CL since
the new shutdown logic by itself left some tests flaky due to clicks not being
delivered consistently from the test framework.

Change-Id: I6d48b259677c92bac323db0e10803a48718d4a33
Bug: 1014159, 998307
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874824
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712391}

Copy link
Collaborator

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-1874824 branch 4 times, most recently from 0b7ebdf to 557f47e Compare November 4, 2019 21:43
While investigating a flaky test, one of the issues found was that a session
'end' event is triggered directly after issuing the session.end() call, without
waiting for device-side session teardown to proceed. As a result, requesting a
new session could fail due to the device side thinking there's already an
active immersive session.

According to https://immersive-web.github.io/webxr/#ended and discussions with
Brandon, expected behavior is that the 'end' event and end().then promise
resolution should be delayed if needed to ensure that a new session can
be started at that time.

This CL adds a "ended but not yet shut down" state to XRSession, and adds
a new ShutdownSession call to isolated_xr_service's XRRuntime, to enable
the expected delay. In case of mojo communication errors, the shutdown
happens immediately.

Also update WebXrTestFramework's enterSessionWithUserGesture to detect
and retry clicks that aren't delivered after session end transitions, and
remove sleeps that were previously added to work around flakiness in WebXR
VR consent tests. It appears that this flakiness was at least in part caused
by prematurely starting a new session while the previous session wasn't
fully shut down yet. The test change is included in the same CL since
the new shutdown logic by itself left some tests flaky due to clicks not being
delivered consistently from the test framework.

Change-Id: I6d48b259677c92bac323db0e10803a48718d4a33
Bug: 1014159, 998307
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874824
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712391}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants