Repository navigation
fix(browser): drop the cached page even when reset raises - #329
Merged
Merged
Conversation
Browser#reset only cleared @page after super returned, so a reset that raised (e.g. a context whose disposal timed out) left Cuprite holding a page whose session was already gone, and every later example failed. Clear it, the window size and the driver's started flag in an ensure. Refs #274, rubycdp/ferrum#641
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #274, rubycdp/ferrum#641
Browser#resetcleared@pageonly aftersuperreturned. When Ferrum's reset raised, e.g. a browser context whose disposal timed out (rubycdp/ferrum#641), Cuprite kept a page whose session was already gone, and every later example failed withSession with given id not found/Browser is dead or given window is closed. One hang cost the whole process.Browser#resetresets the window size and drops the cached page in anensure.Driver#reset!resets@startedin anensure.spec/lib/driver_spec.rb: the reset disposes the context and then raises; the nextvisitmust still work. It fails without the fix.The Ferrum side, which keeps
resetfrom failing forever after one stuck disposal, is rubycdp/ferrum#642.