We have a large cucumber suite for a rails project. It is all capybara and mostly goes via Firefox.
Recently we started to experience a failure, that I am struggling to get my head around. Here is what it looks like:
visit
gets stuck in trying to load the page and capybara eventually times out to find whatever element was looking for (see trace below); every subsequent visit in every other feature also times out;One detail that may or may not be relevant: we are using multiple sessions (capybara using_session
), so there are three firefox instances by the time of failure. But then again, there are three instances happily passing before that.
The same behaviour shows up on my mate's machine.
Nothing suspicious in rails logs. No sign of that request that is trying to get through.
OSX 10.8.2, ruby 1.9.3, rails 3.2.6, sqlite3, latest capybara/selenium.
Error stack trace:
Timeout::Error (Timeout::Error)
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:1293:in `request'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:745:in `start'
/Users/artem/.rbenv/versions/1.9.3-p194-perf/lib/ruby/1.9.1/net/http.rb:1284:in `request'
(eval):2:in `has_css?'
./features/step_definitions/home_page_steps.rb:70:in `/^I am taken to the products page on the retailer site$/'
features/home_page.feature:21:in `Then I am taken to the products page on the retailer site'
Timeout::Error (Timeout::Error)
EDIT
bundle update
seems to have made it go away
EDIT 2
If you stuck with a similar problem and you are using FireBug (capybara/firebug), try disabling it.
EDIT 3
It's occurred to me that since've we switched from webrick to thin (in test/development), this never happened. It is as simple as adding gem 'thin'
in Gemfile. Might be worth a try.
bundle update
seems to have made it go away
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With