Wait for document to be visible in browsingContext.create with background=false
Categories
(Remote Protocol :: WebDriver BiDi, task, P3)
Tracking
(firefox148 fixed)
| Tracking | Status | |
|---|---|---|
| firefox148 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m18], [wptsync upstream])
Attachments
(5 files, 2 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 2003857 - [bidi] Wait for document to be visible in browsingContext.create with background=false
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Assignee | ||
Comment 1•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
Updated•1 month ago
|
Backed out for causing puppeteer timeouts
| Assignee | ||
Comment 6•1 month ago
|
||
Thanks for the ping. I did spot this on try, but since we had a known intermittent for this failure I assumed it was just this.
I imagine we can have an issue if a consumer is calling browsingContext.create several times in a row quickly. The n-1 call might hang if the next call already created a tab which hides the previous one.
| Assignee | ||
Comment 7•1 month ago
|
||
The current polling approach is very likely to miss updates and face race issues.
| Assignee | ||
Comment 8•1 month ago
|
||
| Assignee | ||
Comment 9•1 month ago
|
||
Using an event to wait for the visibility fixes the issue locally and on some platforms, but it still fails from time to time on CI and more importantly, the puppeteer test still fails on CI (although it also passes locally). At this point I'm not sure we can reliably wait for the visibility to change after using browsingContext.create. It seems hard to account for all the potential scenarios where another tab could be created right next after browsingContext.create created its new tab.
After looking at parallel calls to browsingContext.create, I tested other combinations. I found that doing a browsingContext.create and a browsingContext.activate in parallel was already failing with our current implementation. Similarly this is because we are waiting for visibility to change, but the other command makes it impossible to achieve the expected state.
So we already have a brittle implementation due to waiting for visibility changes and I would not add more to it. Potentially we could still keep the code cleanup, the switch to event instead of polling and the new test. But in terms of fixing the intermittent, I think we should either fix it in the test or update the expectations for win ccov.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 10•1 month ago
|
||
I'm still unsure whether we should fix it in the BiDi implementation or in the tests. I looked at fixing the two currently failing tests, and while that works, it's also a bit hard to justify waiting in those tests. End users might also run into similar situations.
Typically what we are seeing is that the focus step happening during the browsingContext.create might race with another command which is also trying to focus another browsing context. At the moment we are not waiting for the visibility to be set after calling the command. In the activate test (bug 2002827) the new context steals the focus from the context we try to activate in the next command. In the background.py test, it's more straightforward, the visibility is simply not updated yet.
Waiting for the visibility at the end of the command does create potential issues when commands are sent in parallel, or simply if there is a tab creation/selection not controller by the webdriver session. I'm doing a last attempt here to see if waiting for visibility, but with a timeout as an escape hatch, could be a decent compromise. If not, maybe for now we just update expectations, and plan more work on this in the future.
| Assignee | ||
Comment 11•1 month ago
|
||
| Assignee | ||
Comment 12•1 month ago
|
||
| Assignee | ||
Comment 13•1 month ago
|
||
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 14•1 month ago
|
||
Comment 16•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/92c37c3e1a25
https://hg.mozilla.org/mozilla-central/rev/92039cc46919
https://hg.mozilla.org/mozilla-central/rev/32fe9972e6cb
https://hg.mozilla.org/mozilla-central/rev/9e82be20f856
https://hg.mozilla.org/mozilla-central/rev/bd018601bc5c
Description
•