Rescue in Rbuf_Fill': Timeout::Error (Timeout::Error)

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



Leave a reply



Submit