jfirebaugh / konacha

Test your Rails application's JavaScript with the mocha test framework and chai assertion library
Other
1.05k stars 117 forks source link

Konacha just hanging on Ruby 2.0.0 #146

Closed jonhyman closed 10 years ago

jonhyman commented 11 years ago

Hey all, I've seen some other "konacha hanging on Ruby 2.0.0" threads, but I'm still having issues. We're using the default selenium driver and a bundle exec rake konacha:run opens up Firefox but then hangs for hours, it does not time out.

The really weird thing is that if I do this, it works temporarily:

rvm use 1.9.3
#1.9.3 works fine
bundle exec rake konacha:run
rvm use 2.0.0
# now it magically works on 2.0.0!
bundle exec rake konacha:run
# but if I run it again, it hangs!
bundle exec rake konacha:run

Has anyone else experienced this or anything similar?

artemave commented 11 years ago

+1. However, after running specs manually via rake konacha:serve, konacha:run does not hang... until I remove tmp cached assets.

adambaker commented 11 years ago

I'm seeing konacha hang too, apparently at random, and I'm also using ruby 2.0.0. If I try to ctrl-c out of it, it doesn't respond. I have to ctrl-z and kill -9 the process to get it to stop.

I'll see if I can find out more about when it hangs and when it works.

genebot commented 11 years ago

I am experiencing this too on ruby 2.0.0 with poltergeist.

Baael commented 11 years ago

+1 same here, rake tmp:clear hangs konacha:run on poltergeist, but on other drivers it is working fine

(but we need nice headless ;) )

sevos commented 11 years ago

If you do use Unicorn, you might want to try this

  Capybara.server do |app, port|
    Unicorn::Configurator::RACKUP[:port] = port
    Unicorn::Configurator::RACKUP[:set_listener] = true

    server = Unicorn::HttpServer.new(app, worker_processes: 2)
    server.start
  end
artemave commented 11 years ago

@sevos Unicorn didn't fix it for me but Thin did:

  Capybara.server do |app, port|
    require 'rack/handler/thin'
    Rack::Handler::Thin.run(app, :Port => port)
  end
jonhyman commented 11 years ago

Has anyone else had success fixing this? The Unicorn and Thin attempts haven't worked for me.

EamonNerbonne commented 11 years ago

Same problem here; some additional info:

This problem didn't occur even after a ruby 2 upgrade, but did once I later upgraded capybara (from 1.1 to 2.1) and poltergeist (from 1.0.3 to 1.3.0). I'm using thin anyhow, and that fix works for me.

deltadd commented 11 years ago

This works for us:

if defined?(Konacha)
  require 'capybara/poltergeist'

  Capybara.register_driver :slow_poltergeist do |app|
    Capybara::Poltergeist::Driver.new(app, :timeout => 5.minutes)
  end

  Konacha.configure do |config|
    config.spec_dir = "spec/javascripts"
    config.driver = :slow_poltergeist
  end
end
3den commented 11 years ago

Konacha works fine with ruby-2.0.0-p247

jrust commented 10 years ago

Also just upgraded to ruby 2.0.0-p247 and it is hanging, both on OSX and CentOS 6. Strangely, it hangs in our core app, but not in an engine.

3den commented 10 years ago

unfortunately that didn't solved the problem on my CI but it does work if you use thin, i am posting the hack that worked for me bellow:

Konacha.configure do |config|
  require 'capybara/poltergeist'
  config.spec_dir     = "spec/javascripts"
  config.driver       = :poltergeist

  Capybara.server do |app, port|
    require 'rack/handler/thin'
    Rack::Handler::Thin.run(app, Port: port)
  end
end if defined?(Konacha)
3den commented 10 years ago

@jrust btw you will need gem 'thin'

jrust commented 10 years ago

@3den thank you! I had seen that workaround above but wasn't sure where to put it. That worked great.

Emerson commented 10 years ago

That hack does not work for me.

EamonNerbonne commented 10 years ago

@Emerson you're using thin?

Emerson commented 10 years ago

@EamonNerbonne - update totally works now using thin. I had some weird issue that was solved when I emptied my /tmp folder.

EamonNerbonne commented 10 years ago

Great!

westonplatter commented 9 years ago

+1 for deleting my_rails_app/tmp folder and running again.