Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

webkit_server: Fatal IO error: client killed #356

Closed
Govinda-Fichtner opened this Issue Jul 5, 2012 · 4 comments

Comments

Projects
None yet
5 participants

Hello guys,

I am having a problem in getting capybara-webkit running headlessly on my integration system.

I am using:
Ubuntu 12.04
ruby 1.9.3p194
Qt version 4.8.1
capybara-webkit 0.12.1
capybara 1.1.2
cucumber 1.2.1
headless 0.2.2

When I am using the headless gem to create and destroy an xvfb instance for a test that needs javascript
the following before and after hooks produce an error:

# only use headless gem on the cruise system and if it is really necessary
Before('@selenium,@javascript') do
  if ENV['CRUISE'] == 'true'
    if Capybara.current_driver == :webkit
      require 'headless'

      @headless = Headless.new
      @headless.start
    end
  end
end

After('@selenium,@javascript') do
  if ENV['CRUISE'] == 'true'
    if Capybara.current_driver == :webkit
      @headless.destroy
    end
  end
end

The error:

webkit_server: Fatal IO error: client killed
      Broken pipe (Errno::EPIPE)
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:21:in `write'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:21:in `puts'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:21:in `puts'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/browser.rb:81:in `command'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/browser.rb:22:in `reset!'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit.rb:108:in `reset!'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/session.rb:70:in `reset!'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/dsl.rb:87:in `block in reset_sessions!'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/dsl.rb:87:in `each'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/dsl.rb:87:in `reset_sessions!'
      /home/cruisecontrolrb/.cruise/projects/imageserver/work/vendor/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/cucumber.rb:10:in `After'

When I remove the after hook everything seems to run fine - but of course the xvfb instance is not destroyed. As all examples you can google are based also on destroying the xvfb instance I wonder what could fix this issue...

I am seeing the same after upgrading to rspec 2.11, the weird thing is that it intermittently fails after 50m or so. Here is the environment:

Ubuntu 11.10
ruby 1.9.3p125
Qt version 4.7.4
capybara-webkit 0.11.0
capybara 1.1.2
cucumber 1.0.2
headless 0.3.1

Owner

jferris commented Nov 9, 2012

The broken pipe errors are usually the result of server crashes. We just released 0.13 which contains fixes for a bunch of crashes. Can you try again on the latest release?

@SaitoWu SaitoWu referenced this issue in gitlabhq/gitlabhq Nov 13, 2012

Merged

Update thin closes #1765 and maybe #1051 #1968

alecnmk commented Nov 22, 2012

experiencing the same failure with latest capybara-webkit 0.13.0 on CI, I'll try to run w/o after hook that's shutting down headless

Collaborator

mhoran commented Jan 1, 2013

The problem is that @headless.destroy is killing Xvfb before capybara-webkit has finished. Killing the Xvfb server capybara-webkit is running under will cause a crash. I'd recommend leaving the Xvfb server running for the duration of the tests, since that will almost certainly be faster than shutting it down and spinning it up again. There's not much we can do here, since capybara-webkit can't run without an X server.

@mhoran mhoran closed this Jan 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment