-
Notifications
You must be signed in to change notification settings - Fork 42
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
Dispose panic after clicking on an element inside another frame #1089
Comments
I have a good idea what is happening, and I believe While testing the fix for #1252 with #1254 I noticed an increase in In my investigation I've sprinkled some When running the script in this issue with the branch provided at the commit before the fix (2f5ea59), you will see the following logs (redacted most of the logs and only showcasing the ones that are valuable to demonstrate the issue):
The key points are:
Looking at these steps it feels to me that it is clear that the The two options we have to resolve this issue are:
I'm not entirely sure of the My preference would be to check for the context closed error in dispose (such as in beba74e) and ignore those types of errors. When this fix is in place, the test ends with no errors or panics. Another question is why does the module even perform a |
Thanks for the investigation, @ankur22 🙇 I think the first solution is better since the iteration shouldn't end before all the resources are cleaned up (the context canceled error shouldn't reach to the disposal stage (ideally!). However, the second solution (the current one) is good enough, as there is no reason to panic after the context is canceled. So, I'm happy with the second approach. |
Playwright has an involved handling of handle disposition. It might give us a better idea if we could run a Playwright script and watch the CDP messages sent by Playwright to see if Playwright sends a |
I've looked at the code, and can't see it happen, i can double check with some logs of the CDP commands though. Any idea why we need this in the first place? |
Yep. That's weird because when a frame navigates, the execution context drops, and the browser should automatically release the handles within the execution context. We could create a web page that creates millions of objects and then navigates (detaches the frame) to see if it impacts the browser memory used. Let me know if I can help. |
@ankur22 Should this be closed? |
Brief summary
We receive a panic after clicking on an element inside another frame.
Early investigation result
The issue seems to be happening because we dispose of the main document after closing the browser with
Runtime.releaseObject
.xk6-browser version
v1.1.0
Steps to reproduce the problem
Expected behaviour
No panic.
Actual behaviour
Panics with:
Tasks
The text was updated successfully, but these errors were encountered: