waitForWindow() in "WebDriver:NewSession" hangs forever if no window is found
Categories
(Remote Protocol :: Marionette, defect)
Tracking
(firefox-esr78 unaffected, firefox86 unaffected, firefox87 unaffected, firefox88 fixed, firefox89 fixed)
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox86 | --- | unaffected |
firefox87 | --- | unaffected |
firefox88 | --- | fixed |
firefox89 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Regression)
Details
(Keywords: hang, regression)
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
This is a regression from bug 1696878 in Firefox 88. Due to the usage of a plain Promise the call to waitForWindow()
never causes the Promise to resolve when there is no browser window. This is a problem in some GeckoView scenarios:
(In reply to Andrew Creskey [:acreskey] [he/him] from bug 1700290 comment #7)
Maybe this is not possible, but could we still launch and not block on
waitForWindow()
?So that we could use geckodriver for other scenarios that don't involve a browser window.
Currently the Fenix MAIN tests do this -- they launch Fenix via geckodriver and then ignore the Marionette exception because Fenix is launched and that's all we need.
As such we should make use of a TimedPromise
and probably fail the WebDriver:NewSession
command. I would have to check that this doesn't cause a force stop of the application.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Andrew, would the patch as attached work for you? If not you cannot use geckodriver to just start Fenix in a mode that is not supported. Code in the new session command requires a valid application window.
Assignee | ||
Comment 3•4 years ago
|
||
So without the patch on bug 1696878 we failed with an error like:
1616662638227 Marionette DEBUG 1 -> [0,1,"WebDriver:NewSession",{"strictFileInteractability":true}]
1616662638228 Marionette DEBUG 1 <- [1,1,{"error":"unknown error","message":"TypeError: can't access property \"register\", this.curBrowser is null","stacktrace" ... t@chrome://marionette/content/server.js:238:9\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:504:20\n"},null]
This is actually problematic because per WebDriver spec the command should only throw a SessionNotCreated
error. As such the changes in my proposed patch make sense.
Comment 5•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Comment on attachment 9211360 [details]
Bug 1700755 - [marionette] Use TimedPromise when waiting for initial application windows.
Beta/Release Uplift Approval Request
- User impact if declined: Tests for WebDriver / Marionette will hang during startup of Firefox for Android if a wrong activity has been chosen and no window of a supported window type is open.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Uses a timed promise to break out of searching for a supported window type after 1.5s (4.5s debug build). Reverts to the pre-bug 1696878 behavior including a spec conformant error message.
- String changes made/needed:
Comment 7•4 years ago
|
||
Comment on attachment 9211360 [details]
Bug 1700755 - [marionette] Use TimedPromise when waiting for initial application windows.
Approved for 88.0b5.
Comment 8•4 years ago
|
||
bugherder uplift |
Updated•2 years ago
|
Description
•