browsingContext.setViewport can timeout if several contexts are created in parallel
Categories
(Remote Protocol :: WebDriver BiDi, defect, P3)
Tracking
(firefox150 fixed)
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [webdriver:m19][webdriver:relnote])
Attachments
(1 external file, 1 obsolete file)
See Bug 1789544, the current logic which expects a resize event is fragile and can timeout if several browsing contexts are created in parallel.
| Assignee | ||
Comment 1•8 months ago
|
||
Post patch + details about the failure.
| Assignee | ||
Comment 2•8 months ago
|
||
(In reply to Julian Descottes [:jdescottes] from Bug 1789544 comment #44)
For info, I modified https://searchfox.org/firefox-main/rev/3c52c9c886f7b0423001cef86abfafcf97f2b90a/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs#2552-2570
if (targetHeight !== currentHeight || targetWidth !== currentWidth) { if (!navigable.isActive) { // Force a synchronous update of the remote browser dimensions so that // background tabs get resized. browser.ownerDocument.synchronouslyUpdateRemoteBrowserDimensions( /* aIncludeInactive = */ true ); } // Wait until the viewport has been resized await this._forwardToWindowGlobal( "_awaitViewportDimensions", navigable.id, { height: targetHeight, width: targetWidth, }, { retryOnAbort: true } ); }to stop checking
navigable.isActive, I think there's no guarantee that the navigable will remain active until the_awaitViewportDimentioncommand is received. That seems to fix this intermittent.Alternatively we could use the same approach as for
_awaitVisibilityStateand use a timeout (which we implemented in Bug 2003857 - Wait for document to be visible in browsingContext.create with background=false)
There is some additional info in the Bug 1789544 comment #43 as well. While the fix suggested above seems to fix the intermittent, I wasn't able to write a wdspec test to replicate the issue yet.
Comment 3•8 months ago
|
||
Thanks Julian. So even the wdspec test you wrote doesn't reproduce the issue, could you maybe attach it to the bug?
| Assignee | ||
Comment 4•8 months ago
|
||
Updated•8 months ago
|
| Assignee | ||
Comment 6•8 months ago
|
||
Updated•8 months ago
|
Comment 8•8 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•8 months ago
|
Comment 9•8 months ago
|
||
Comment on attachment 9550595 [details]
Bug 2019511 - [wdspec] Add test for parallel setViewport calls
Revision D286451 was moved to bug 2022762. Setting attachment 9550595 [details] to obsolete.
Comment 10•7 months ago
|
||
The failure on bug 1789544 is still visible for mozilla-beta (but with only 2 failures). I assume it's already too late to uplift, or should we try?
| Assignee | ||
Comment 11•7 months ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #10)
The failure on bug 1789544 is still visible for mozilla-beta (but with only 2 failures). I assume it's already too late to uplift, or should we try?
It's not too late, but the failure rate is low enough I don't think it's worth the effort.
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
Description
•