Sharing a WebDriver session with Marionette doesn't wait for browserStartupFinished
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox100 unaffected, firefox101 fixed, firefox102 fixed)
Tracking | Status | |
---|---|---|
firefox100 | --- | unaffected |
firefox101 | --- | fixed |
firefox102 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
(Whiteboard: [bidi-m3-mvp])
Attachments
(4 files)
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
Currently we have the situation on Android that WebDriver BiDi and CDP tests of the webdriver test suite are failing if tests make use of a direct connection and not geckodriver. If the tests use geckodriver all the tests are passing.
Here are the reasons for:
-
On Android the
sessionstore-windows-restored
observer notification is not used and as such the/session
path handler is never registered. -
WebDriver BiDi connections as initiated by WebDriver HTTP by passing the
webSocketURL
capability will not take the above code path. Instead they callWebDriverBiDi:createSession
directly and setup the appropriate/session/%id%
path handler.
To solve this two fixes are needed:
-
Instead of
sessionstore-windows-restored
we probably should usebrowser-idle-startup-tasks-finished
for browsers andmail-idle-startup-tasks-finished
for Thunderbird. We would still have to differentiate between these two and maybe others in the future. That opens the question if maybe we should keep themarionette-startup-requested
andremote-startup-requested
notifications whereby the latter would have to be re-introduced. It might be cleaner and applications can define where to get these added. Maybe we should rename these to a more appropriate name likemarionette-final-startup-requested
andremote-final-startup-requested
? -
Extending the check in
createSession
to not only cover thethis.agent.running
state but also awaits forbrowserStartupFinished
.
Julian, would do you think about 1)? Would you join the idea to keep the remote/marionette specific notifications in the application code? I don't like the removal and re-adding of this code but maybe it's still better as having to handle different observers per application.
Comment 1•2 years ago
|
||
Thanks for the investigation. Basically we have to choose between relying on existing events or re-introducing specific events for remote.
Ideally I feel like we should have a platform event, that works on mobile/desktop/thunderbird etc... and which notifies us that startup is fully finished and that the browser can now be used.
Given the current situation, I don't have a strong preference. But if browser-idle-startup-tasks-finished
is a good match here (minus the fact that it's called differently for Thunderbird), I lean towards using it instead of (re)introducing another event. I'm worried that with a different event, folks might move "browser-idle-startup-tasks-finished" but leave out our event because it's not clear that they are closely related. And we are not waiting for anything else than browser-idle-startup-tasks-finished
, so we would really just create a duplicated event. If we had to wait for other things, if we had some custom logic... that would be another discussion.
Maybe in a followup we can start asking platform to align and emit the same event across all applications.
As I said no strong preference, so if you prefer to re-introduce custom events, I'm also fine with that.
Assignee | ||
Comment 2•2 years ago
|
||
Good points Julian! I agree and lets move forward by using these platform events instead, which means continuing what we already decided on. I'll make a patch to get this bug fixed as soon as possible.
Assignee | ||
Comment 3•2 years ago
|
||
This also blocks the windowless support in Marionette.
Assignee | ||
Comment 4•2 years ago
|
||
This observer notification is only available on desktop and for
applications that actually use the feature. This is not the case
for GeckoView and as such it cannot be used.
Instead the notifications "browser-idle-startup-tasks-finished"
and "mail-idle-startup-tasks-finished" can be used. These also
align to our formerly used custom "remote-startup-requested"
notification, which now no longer exists.
Assignee | ||
Comment 5•2 years ago
|
||
Previously the check has been added when starting the protocol.
But given that httpd.js gets started already in final-ui-startup
a new BiDi session request from Marionette can add required
path handlers, which results in accepting incoming commands
even with the browser not fully started up yet.
Depends on D145310
Assignee | ||
Comment 6•2 years ago
|
||
Similar to WebDriver BiDi the JSON handlers for the CDP protocol
should be immediately registered, so that only the announcement
that CDP is enabled gets delayed.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D145311
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c72c57c55390 [remote-cdp] Register handlers for httpd.js before waiting for the initial application window. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/fd4bd21f54fe [remote] Don't use sessionstore-windows-restored to determine whenapplication is fully started. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/056c67d81fe6 [remote-bidi] Also await browser startup finished when creating a newsession from Marionette. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/621def30243d [wdspec] Remove remaining obsolete release_or_beta disable flags. r=webdriver-reviewers,jdescottes
Comment 9•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c72c57c55390
https://hg.mozilla.org/mozilla-central/rev/fd4bd21f54fe
https://hg.mozilla.org/mozilla-central/rev/056c67d81fe6
https://hg.mozilla.org/mozilla-central/rev/621def30243d
Comment 10•2 years ago
|
||
Comment on attachment 9274782 [details]
Bug 1767387 - [remote] Don't use sessionstore-windows-restored to determine whenapplication is fully started.
Covered by the approval request in https://bugzilla.mozilla.org/show_bug.cgi?id=1753997#c14. Note for the future that we strongly prefer that each bug get its own approval requests, however. Approved for 101.0b3.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 11•2 years ago
|
||
bugherder uplift |
Description
•