rescue in rbuf_fill': Timeout::Error (Timeout::Error)
Found this while perusing the web. Hopes it helps somebody! Setting a longer timeout
Here is how you can adjust the timeout in the Net::HTTP API:
require 'net/http'
http = Net::HTTP.new(@host, @port)
http.read_timeout = 500
/usr/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout::Error (Timeout::Error)
I've seen a similar trace before and 2 potential causes for it:
1) gems like FakeWeb and WebMock modify ruby's http. Try removing those gems and any similar ones you may be using to mock/block web requests.
2) I've seen a case in a really loaded down system where this timeout would occur somewhat randomly. Really the issue here wasn't the test but the system and what was running on it. It's possible to change the timeout used by the http library and continue testing.
Updated for Capybara: (from http://selenium.googlecode.com/svn/wiki/RubyBindings.wiki)
Capybara.register_driver :selenium_extended_http_timeout do |app|
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 240
Capybara::Selenium::Driver.new(app,
:browser => :firefox,
:http_client => client,
:resynchronization_timeout => 60,
:resynchronize => true)
end
Capybara.javascript_driver = :selenium_extended_http_timeout
There's a good chance you don't need the resynchronization stuff.
In both cases this is related to how selenium does some of its internal communications. The JsonWireProtocol.
Related Topics
How to Get Filename Without Extension from File Path in Ruby
How to Create a Sha1 Hash in Ruby
How to Get Ruby/Homebrew/Rvm to Work on Yosemite
What Does Class_Eval ≪≪-"End_Eval", _File_, _Line_ Mean in Ruby
"Certificate Verify Failed" Openssl Error When Using Ruby 1.9.3
Ruby: How to Copy a Variable Without Pointing to the Same Object
How to Edit or Write on Existing Pdf With Ruby
Eoferror: End of File Reached Issue With Net::Http
To Use Self. or Not.. in Rails
Ruby/Rails - Change the Timezone of a Time, Without Changing the Value
Understanding Ruby and Os I/O Buffering
Set Socket Timeout in Ruby Via So_Rcvtimeo Socket Option
String.Force_Encoding() in Ruby 1.8.7 (Or Rails 2.X)
Execute Bash Commands from a Rakefile
Unzip (Zip, Tar, Tag.Gz) Files With Ruby
Performance of Arrays and Hashes in Ruby