Skip to content

Retry Document#visit on Net::ReadTimeout#206

Merged
tlconnor merged 1 commit intomasterfrom
retryVisit
May 29, 2018
Merged

Retry Document#visit on Net::ReadTimeout#206
tlconnor merged 1 commit intomasterfrom
retryVisit

Conversation

@tlconnor
Copy link
Copy Markdown

@tlconnor tlconnor commented May 20, 2018

Sometimes tests will flake due to a Net::ReadTimeout error. These have been identified as occurring when multiple page loads occur in quick succession.

Take the example below:

page.perform_some_action!
assert_equal "some validation error", page.validation_errors
SomeOtherPageObject.visit

In this example the perform_some_action! call results in a page load. If the following .visit call occurs before the page is fully loaded (including all ajax requests) the Net::ReadTimeout can occur. This issue is very easy to reproduce when using websocket libraries that initialize a websocket on page load. These libraries often fall back to long-polling, which can result in an HTTP request being held open for ~60s.

The issue is not completely solvable in ae_page_objects, however it can be mostly mitigated by adding retry logic to Page.load.

@pkmiec pkmiec self-requested a review May 29, 2018 16:44
@tlconnor tlconnor merged commit 9b7c0d2 into master May 29, 2018
@tlconnor tlconnor deleted the retryVisit branch May 29, 2018 16:47
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.

2 participants