thoughtbot/capybara-webkit — Issue #197: visit(url) hangs on Jruby
Author: duelinmarkers
Created: 2011-10-24 15:49:31+00:00
State: open

It looks to me like this is a Jruby issue, but it seemed worth raising so at least capybara-webkit users will know about it.

When we call visit (or any browser command with an empty response) we're seeing the browser block when it tries to read the response. Cutting capybara-webkit out of the picture, it appears Jruby's `TCPSocket` blocks when there's nothing to read, even when the argument to `read` is zero. MRI returns an empty string immediately.

We have a workaround for this in our fork here: https://github.com/intentmedia/capybara-webkit/commit/73100d7dc14b566a6c4cc0c3b23c5ab784ccc74f

Tested with Jruby 1.6.3 and 1.6.4 with
`java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)`
on OS X 10.6.8