3
votes

I've upgraded to Rails 4.0.0 from Rails 3.2.13. I fixed all the deprecation warnings (except for secret_base_key), upgraded database_cleaner, rspec, rspec-rails, capybara, selenium-webdriver and poltergeist to the latest versions.

Now, when I run my specs, through rake or rspec, the output of rspec eventually hangs, always on a feature test (a javascript one). The output of test.log is clear: the tests are still running, but the console is not getting any updates.

I am using:

  • phantomjs 1.9.2.
  • poltergeist 1.4.1

Thoughts on how I can get my test suite to behave normally again?

1
sure, that you did not leave any debugger, pry or sleep statements in the code?phoet
I just checked. There are a few sleep statements, but they are a few seconds at worst.Trevoke
is it possible to narrow it down to some tests?phoet
It hangs on any of six feature tests, all of them "js: true".Trevoke
might be some problem with your javascript drivers. did you try re-installing them? what do you use? selenium or some headless driver?phoet

1 Answers

6
votes

I had the same problem, but with capybara-webkit.

I found the solution here: webkit_server hangs periodically when run from Capybara in Ruby

# Gemfile
group :test do
  gem 'thin'
end

# spec_helper.rb
Capybara.javascript_driver = :webkit
Capybara.server do |app, port|
  require 'rack/handler/thin'
  Rack::Handler::Thin.run(app, :Port => port)
end