0

Whenever I attempt to run tests against capybara-webkit, it is not able to find the listening port, so it attempts to use 0, which results in the following error:

Failure/Error: visit user_path
Errno::EADDRNOTAVAIL:
  The requested address is not valid in its context. - connect(2)

After a significant amount of time spent debugging the functionality of capybara-webkit, I found that the problem is the following line of code (capybara-webkit-1.1.1/lib/capybara/webkit/connection.rb::open_pipe):

_, @pipe_stdout, @pipe_stderr, wait_thr = Open3.popen3(SERVER_PATH)

When that invokes the WebKit server, the WebKit server launches and should output something similar to the following to STDOUT:

Capybara-webkit server started, listening on port: 53467

When I launch the process manually in a console, that is certainly what I see. However, whenever I try to read @pipe_stdout or @pipe_stderr all I get is nil. Even if I wait until the pipe is ready (as seen in the capybara-webkit connection class) for reading using:

IO.select([@pipe_stdout], nil, nil, WEBKIT_SERVER_START_TIMEOUT)

I still see the same problem. I'm pretty much a novice when it comes to Ruby IO classes, etc. I've tried everything that I can think of to test/debug this and get Open3.popen3 to correctly return the same message to STDOUT that I can see in the console to no avail.

Any thoughts or ideas on something else to try? Is there something obvious that I'm missing? I know that most of the Capybara maintainers work on Mac and this all seems to work for them, so maybe this is an issue with how popen3 is working with Windows?

Shadowcat
  • 423
  • 4
  • 8
  • For reference, I created a similar issue in the capybara-webkit project: https://github.com/thoughtbot/capybara-webkit/issues/605 – Shadowcat Jan 03 '14 at 01:30
  • Unfortunately no. It appears that there aren't any maintainers that run Windows so there isn't much help to be found. The only other thing I could think to try would be to post a similar question in a Windows/Microsoft oriented forum and see if they could offer generic advice about why piping popen may not work in Windows. – Shadowcat Mar 20 '14 at 16:26
  • I am abandoning hope on webkit.. I guess I will use poltergeist for my usecase and see where it takes me! – Gaurav Agarwal Mar 21 '14 at 03:51
  • BTW.. which version of ruby are we using? – Gaurav Agarwal Mar 26 '14 at 12:39
  • I'm using Ruby 1.9.3p327 – Shadowcat Apr 01 '14 at 17:55

0 Answers0