Skip to content
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

fix: address flakiness in frame handling #8688

Merged
merged 1 commit into from Jul 25, 2022

Conversation

OrKoN
Copy link
Collaborator

@OrKoN OrKoN commented Jul 22, 2022

When we attach to a frame, we send a call to get
the page frame tree from CDP. Based on the tree data
we look up the parent frame if parentId is provided.
The problem is that the call to get the page frame
tree could take arbitrary time and the calls for the
parent and child frames might happen at the same time.
So the situation where the frame tree for the child frame
is resolved before the parent frame is known is fairly
common.

This PR addresses the issue by awaiting for the parent
frame id before attempting to register a child frame.

@OrKoN OrKoN force-pushed the fix-parent-child-frame-flakiness branch 5 times, most recently from 2ea6f88 to e17a052 Compare July 25, 2022 05:41
@OrKoN OrKoN changed the title fix: attempt at fixing child-parent frame flakiness fix: address flakiness in frame handling Jul 25, 2022
When we attach to a frame, we send a call to get
the page frame tree from CDP. Based on the tree data
we look up the parent frame if parentId is provided.
The problem is that the call to get the page frame
tree could take arbitrary time and the calls for the
parent and child frames might happen at the same time.
So the situation where the frame tree for the child frame
is resolved before the parent frame is known is fairly
common.

This PR addresses the issue by awaiting for the parent
frame id before attempting to register a child frame.
@OrKoN OrKoN force-pushed the fix-parent-child-frame-flakiness branch from e17a052 to b6c4b52 Compare July 25, 2022 06:13
@OrKoN OrKoN requested a review from mathiasbynens July 25, 2022 06:24
Copy link
Member

@mathiasbynens mathiasbynens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good non-flaky way to test any of this?

@OrKoN
Copy link
Collaborator Author

OrKoN commented Jul 25, 2022

@mathiasbynens I have been thinking about record/replaying CDP messages for test that without an actual Chromium binary but I think it's too much effort to maintain such tests.

@mathiasbynens
Copy link
Member

@mathiasbynens I have been thinking about record/replaying CDP messages for test that without an actual Chromium binary but I think it's too much effort to maintain such tests.

I can imagine the rebaselining getting a bit out of hand, indeed… Oh well. Feel free to land this as-is!

@OrKoN OrKoN merged commit 02c07cc into main Jul 25, 2022
@OrKoN OrKoN deleted the fix-parent-child-frame-flakiness branch July 25, 2022 09:20
jrandolf pushed a commit that referenced this pull request Aug 2, 2022
When we attach to a frame, we send a call to get
the page frame tree from CDP. Based on the tree data
we look up the parent frame if parentId is provided.
The problem is that the call to get the page frame
tree could take arbitrary time and the calls for the
parent and child frames might happen at the same time.
So the situation where the frame tree for the child frame
is resolved before the parent frame is known is fairly
common.

This PR addresses the issue by awaiting for the parent
frame id before attempting to register a child frame.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants