Skip to content

Ruby 1.9 encoding issue #1812

Closed
jonleighton opened this Issue Jul 14, 2012 · 7 comments

2 participants

@jonleighton

Hi guys,

The poltergeist tests are now running great in 1.8 mode, but in 1.9 mode there is a problem:

[At time of writing poltergeist master is at 8cc4c8341f13c9c4790a2af3cc7e21e5f0cd8d57, in case you need to replicate this in the future.]

$ rspec ./spec/integration/driver_spec.rb:44 -b
Run options: include {:locations=>{"./spec/integration/driver_spec.rb"=>[44]}}
F

Failures:

  1) Capybara::Poltergeist::Driver has a viewport size of 1024x768 by default
     Failure/Error: @driver.visit('/')
     Rubinius::EncodingClass::Encoding::CompatibilityError:
       undefined conversion for '"\x13\xE2:\xC9\x11gPL"' from ASCII-8BIT to US-ASCII
     # kernel/common/type19.rb:28:in `compatible_encoding'
     # kernel/common/string19.rb:397:in `<<'
     # kernel/common/string.rb:65:in `+'
     # /home/turnip/Code/rubinius/gems/1.9/gems/faye-websocket-0.4.6/lib/faye/websocket/draft76_parser.rb:37:in `handshake_signature'
     # /home/turnip/Code/rubinius/gems/1.9/gems/faye-websocket-0.4.6/lib/faye/websocket/draft76_parser.rb:11:in `handshake_response'
     # ./lib/capybara/poltergeist/web_socket_server.rb:29:in `handshake_response'
     # ./lib/capybara/poltergeist/web_socket_server.rb:100:in `accept'
     # ./lib/capybara/poltergeist/web_socket_server.rb:143:in `send'
     # ./lib/capybara/poltergeist/server.rb:29:in `send'
     # ./lib/capybara/poltergeist/browser.rb:132:in `command'
     # ./lib/capybara/poltergeist/browser.rb:20:in `visit'
     # ./lib/capybara/poltergeist/driver.rb:78:in `visit'
     # ./spec/integration/driver_spec.rb:45:in `Poltergeist'
     # kernel/common/eval19.rb:45:in `instance_eval'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/example.rb:113:in `run'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/example.rb:110:in `run'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/example_group.rb:378:in `run_examples'
     # kernel/bootstrap/array19.rb:18:in `map'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/example_group.rb:360:in `run'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/command_line.rb:28:in `run'
     # kernel/bootstrap/array19.rb:18:in `map'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/command_line.rb:28:in `run'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/reporter.rb:34:in `report'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/command_line.rb:25:in `run'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/runner.rb:69:in `run'
     # /home/turnip/Code/rubinius/gems/1.9/gems/rspec-core-2.11.0/lib/rspec/core/runner.rb:8:in `autorun'
     # kernel/loader.rb:714:in `run_at_exits'
     # kernel/loader.rb:734:in `epilogue'
     # kernel/loader.rb:864:in `main'

Finished in 0.74172 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/integration/driver_spec.rb:44 # Capybara::Poltergeist::Driver has a viewport size of 1024x768 by default

This error does not occur on any of the other ruby 1.9's I am testing against.

The error comes from this code in @jcoglan's faye-websocket-ruby library.

Cheers!

@jonleighton jonleighton referenced this issue in teampoltergeist/poltergeist Sep 1, 2012
Closed

Rubinius support #75

@brixen
Rubinius member
brixen commented Oct 22, 2012

@jonleighton Would be able to recheck this on master HEAD? I've tried to get the specs running myself but not having much success.

@jonleighton

@brixen looks like it's still a problem. here's a current stack trace:

$ rbx -X19 -S rspec spec/integration/driver_spec.rb:54 -b
Run options: include {:locations=>{"./spec/integration/driver_spec.rb"=>[54]}}
Status line contains embedded null

An error occurred in an after hook
  Capybara::Poltergeist::DeadClient: The PhantomJS client died while processing {"name":"reset","args":[]}
  occurred at /home/turnip/Code/poltergeist/lib/capybara/poltergeist/server.rb:29:in `send'

F

Failures:

  1) Capybara::Poltergeist::Driver has a viewport size of 1024x768 by default
     Failure/Error: @driver.visit('/')
     Encoding::CompatibilityError:
       encodings for ASCII-8BIT and US-ASCII are incompatible
     # kernel/bootstrap/type19.rb:55:in `check_encoding_compatible'
     # kernel/common/string.rb:66:in `+'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/faye-websocket-0.4.6/lib/faye/websocket/draft76_parser.rb:37:in `handshake_signature'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/faye-websocket-0.4.6/lib/faye/websocket/draft76_parser.rb:11:in `handshake_response'
     # ./lib/capybara/poltergeist/web_socket_server.rb:29:in `handshake_response'
     # ./lib/capybara/poltergeist/web_socket_server.rb:100:in `accept'
     # ./lib/capybara/poltergeist/web_socket_server.rb:143:in `send'
     # ./lib/capybara/poltergeist/server.rb:29:in `send'
     # ./lib/capybara/poltergeist/browser.rb:172:in `command'
     # ./lib/capybara/poltergeist/browser.rb:21:in `visit'
     # ./lib/capybara/poltergeist/driver.rb:81:in `visit'
     # ./spec/integration/driver_spec.rb:55:in `Poltergeist'
     # kernel/common/eval19.rb:45:in `instance_eval'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in `run'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `run_examples'
     # kernel/bootstrap/array19.rb:18:in `map'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `run'
     # kernel/bootstrap/array19.rb:18:in `map'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `run'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /home/turnip/.rbenv/versions/rbx-2.0.0-dev/1.9/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `autorun'
     # kernel/loader.rb:696:in `run_at_exits'
     # kernel/loader.rb:716:in `epilogue'
     # kernel/loader.rb:849:in `main'

Finished in 1.73 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/integration/driver_spec.rb:54 # Capybara::Poltergeist::Driver has a viewport size of 1024x768 by default
@jonleighton

@brixen if you want me to help you w/ getting the poltergeist specs running then let me know.

@brixen
Rubinius member
brixen commented Oct 23, 2012

@jonleighton sweet, I have the same error as you. I should be able to fix it soon. Thanks!

@brixen
Rubinius member
brixen commented Oct 30, 2012

@jonleighton this should be fixed, however, there may be a race in your specs. I haven't looked into it in depth but for me, a regular rbx -X19 -S rspec spec/integration/driver_spec.rb will hang with the main thread in an accept() call. I would say this could be a Rubinius bug, but if I run with -Xagent.start too, I don't get a hang but I get an "address in use" exception, which suggests that the server is trying to start up before it has finished shutting down.

Anyway, if you can confirm that master HEAD fixes the encoding issues, we can investigate further.

@jonleighton

@brixen great, the encoding bug definitely seems to be fixed now :)

I'm not sure about the problem you had - the tests run completely clean with no error for me now, with or without -Xagent.start. I ran a few times to be sure. Do you get the problem consistently?

@brixen
Rubinius member
brixen commented Oct 30, 2012

Excellent to hear the encoding problem is fixed.

Yes, I was consistently getting the hang. If you don't, that's great. Hopefully, the Travis VMs will be updated soon and your tests will be green again.

I'll close this for now. Please let us know if you hit any more issues.

@brixen brixen closed this Oct 30, 2012
@haines haines added a commit to haines/draper that referenced this issue Nov 12, 2012
@haines haines Allow rbx failures
Just until the fix for rubinius/rubinius#1812 appears on Travis
02b3b17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.