-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
core(driver): fix legacy runner hanging oopifs in some cases #14074
Conversation
await Promise.all([ | ||
// Events from subtargets will be stringified and sent back on `Target.receivedMessageFromTarget`. | ||
// We want to receive information about network requests from iframes, so enable the Network domain. | ||
this.sendCommandToSession('Network.enable', event.sessionId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this fix the issue? Does it guarantee that Network.enable
finishes after the target is resumed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The protocol doesn't respond to the Network.enable event until the underlying target has been resumed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it guarantee that Network.enable finishes after the target is resumed?
We don't care when the response is acked... and the order of the commands is guaranteed to be processed in the
order we sent them, so we're good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The protocol doesn't respond to the Network.enable event until the underlying target has been resumed.
If that's the case, shouldn't it always have failed and not been flakey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also confused on that point, I mention in the OP.
Update: I made a mistake when confirming this was an issue. I was accidentally testing things with this line commented out:
Without that line, all frames are set to be auto-attached/paused on start. I'm not sure what the difference really is, because the So this isn't fixing a present issue, I guess, but seems good to do anyway. It may end up being necessary / helping with debugging #13861 |
why did I comment that out? because in devtools all of these frame navigated events have a parentId, so I was curious what this line was even for. Turns out, without it OOPIFs hang (in legacy runner CLI). |
While investigating #13861, I noticed that the legacy runner takes a long time on the oopif-scripts.html smoke fixture. This is because the OOPIF target hangs forever, and is never loaded. This was made clear when the second iframe on the test page never rendered any content.
Turns out, we can't do
Network.enable
and await its response if the target is paused.It seems like the
iframe
specific part of_handleTargetAttached
may have always been busted? It's also possible that Chrome CDP internals changed underneath us.I also added a clarifying comment in
_handleTargetAttached
noting that all that logic is only for OOPIFs.