feat(errors): name the command a timeout was waiting on - #631
Merged
Conversation
`Ferrum::TimeoutError` said only that something timed out, so a report of one carried no hint of which command, on which session, was left unanswered. Diagnosing #470 needed full `FERRUM_DEBUG` logs from three reporters to find out it was `Page.enable`. The command and session are now part of the message and exposed as `#command`/`#session_id`. Waits that aren't for a command, network idle for instance, keep the message they had. Refs #470
…es-the-command # Conflicts: # spec/client_spec.rb
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 #470.
The problem
Ferrum::TimeoutErrorsaid only that a response never came:Which command, on which session, isn't in there. #470 is the cost of that: it took a year, three reporters and a full
FERRUM_DEBUGtranscript to establish that the command left unanswered wasPage.enableon a freshly created page.The change
The command and the session are part of the message, and readable off the error:
Only
Client#send_messagepasses them, since it's the only place that waits on a specific command. The waits that aren't for one,Network#wait_for_idleandPage#command's post-command event wait, raise the same message as before, and a browser-session command getsa response to Target.createTargetwith no session part.Verification
spec/client_spec.rb: aPage.navigateto the app's slow route with a short timeout raises witha response to Page.navigate (session ...).