-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Avoid Net::ReadTimeout errors in tests #3683
Merged
Merged
Conversation
This file contains 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
javierm
force-pushed
the
capybara_webmock
branch
from
September 5, 2019 15:48
aef61b5
to
12bea0c
Compare
javierm
changed the title
Use capybara-webmock to avoid external requests
Use capybara-webmock to avoid timeout errors
Sep 5, 2019
javierm
changed the title
Use capybara-webmock to avoid timeout errors
Avoid timeout errors in tests
Sep 5, 2019
javierm
changed the title
Avoid timeout errors in tests
Avoid Net::ReadTimeout errors in tests
Sep 5, 2019
javierm
force-pushed
the
capybara_webmock
branch
from
September 5, 2019 16:33
12bea0c
to
bbb4a6a
Compare
houndci-bot
reviewed
Sep 5, 2019
@@ -33,7 +33,9 @@ | |||
|
|||
Capybara.register_driver :headless_chrome do |app| | |||
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |||
chromeOptions: { args: %w(headless no-sandbox window-size=1200,600) } | |||
chromeOptions: { | |||
args: %W[headless no-sandbox window-size=1200,600 proxy-server=127.0.0.1:#{Capybara::Webmock.port_number}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [112/110] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
javierm
force-pushed
the
capybara_webmock
branch
from
September 6, 2019 20:29
bbb4a6a
to
df6cfe4
Compare
javierm
force-pushed
the
inline_ckeditor
branch
from
September 6, 2019 22:03
590b4f1
to
3368e8f
Compare
javierm
force-pushed
the
capybara_webmock
branch
2 times, most recently
from
September 7, 2019 10:56
89a68e9
to
a784261
Compare
The images from OpenStreetMap take a while to load, sometimes even causing Net::ReadTimeout errors if the internet connection is slow. It's happened a lot recently on Travis builds. Using capybara-webmock we guarantee the test suite doesn't fail due to network issues.
javierm
force-pushed
the
capybara_webmock
branch
from
September 7, 2019 11:23
a784261
to
8bb5462
Compare
smarques
pushed a commit
to venetochevogliamo/consul
that referenced
this pull request
Apr 29, 2020
Avoid Net::ReadTimeout errors in tests
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.
Background
Since August the 7th, 2019, we're experiencing
Net::ReadTimeout
errors on almost every Travis build.Debugging shows most (maybe all) of these errors come from requesting images to OpenStreetMap. Sometimes, due to an unreliable internet connection, the images take too long to load. The issue can be reproduced locally by limiting the bandwidth of the development machine with tools like wondershaper.
Objectives
Mock HTTP requests to fetch OpenStreetMap images, so we don't get any timeout errors, and tests work properly on machines with slow internet connections.
Notes
Here are the builds which have failed with the
Net::ReadTimeout
exception. Most (if not all) of these failures take place on pages loading the map.Travis build 31262, job 1 and Travis build 31303, job 5
Travis build 31293, job 3
Travis build 31299, job 2
Travis build 31299, job 2 and Travis build 31320, job 3
Travis build 31300, job 4, Travis build 31306, job 1, Travis build 31309, job 1 and Travis build 31320, job 3
Travis build 31309, job 1 and Travis build 31326, job 1
Travis build 31306, job 1
Travis build 31303, job 1 and Travis build 31322, job 3
Travis build 31303, job 4
Travis build 31311, job 2
Travis build 31264, job 5, Travis build 31298, job 5, Travis build 31308, job 3, Travis build 31319, job 3, Travis build 31321, job 5, Travis build 31323, job 2, Travis build 31324, job 3 and Travis build 31325, job 1
Travis build 31296, job 2, Travis build 31313, job 5 and Travis build 31319, job 2
Travis build 31313, job 5
Travis build 31296, job 4
Travis build 31302, job 5 and Travis build 31311, job 5
Travis build 31306, job 5 and Travis build 31310, job 5