Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for JRuby in Travis, tests, gemspec #246

Conversation

olleolleolle
Copy link
Contributor

@olleolleolle olleolleolle commented Sep 21, 2016

On jruby-9k, we always fail on installing a development dependency which is used to generate documentation. Illustration: Example failure to build

This PR improves things for JRuby:

  • uses Kramdown for Markdown on JRuby
  • skips using the QUIT signal in the tests, on the JRuby platform
  • configures JRUBY_OPTS=--debug in builds
  • removes JRuby from Travis' allowed_failures
  • relies on latest published JRuby: jruby-9.1.5.0
  • has a fine explanation/theory on what could have caused a weird stacktrace
  • (and as a bonus round) upgrades the Airbrake error handler to its modern form (5.x)

Result:

  • Travis builds on JRuby pass, and can publish test coverage data.

@olleolleolle
Copy link
Contributor Author

Oh, the QUIT handler must be skipped on this platform.

Hutch::Waiter
  .wait_until_signaled
    a QUIT signal is received
The signal QUIT is in use by the JVM and will not work correctly on this platform
2016-09-21 16:12:33
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.76-b04 mixed mode):

  - support old kind of notification, change handler to new-style and move tests to current mode
@olleolleolle
Copy link
Contributor Author

Ah, also, the Airbrake gem no longer supports the method that the error handler here was testing and using.

So I included an upgraded spec.

@olleolleolle olleolleolle changed the title Gemspec: Do not need redcarpet on JRuby, bump yard to 0.9 Better support for JRuby in Travis, tests, gemspec Sep 21, 2016
@olleolleolle
Copy link
Contributor Author

olleolleolle commented Sep 21, 2016

The allowed_failures is about avoiding errors like these in MarchHare's Session class line 505:

  1) Hutch::Broker#open_connection does not set #connection
     Failure/Error: Unable to find java.net.SocksSocketImpl.remainingMillis(java/net/SocksSocketImpl.java to read failed line
     Java::JavaNet::SocketTimeoutException:
     # java.net.SocksSocketImpl.remainingMillis(java/net/SocksSocketImpl.java:111)
     # java.net.SocksSocketImpl.connect(java/net/SocksSocketImpl.java:392)
     # java.net.Socket.connect(java/net/Socket.java:579)
     # com.rabbitmq.client.impl.FrameHandlerFactory.create(com/rabbitmq/client/impl/FrameHandlerFactory.java:47)
     # com.rabbitmq.client.ConnectionFactory.newConnection(com/rabbitmq/client/ConnectionFactory.java:822)
     # com.rabbitmq.client.ConnectionFactory.newConnection(com/rabbitmq/client/ConnectionFactory.java:778)
     # com.rabbitmq.client.ConnectionFactory.newConnection(com/rabbitmq/client/ConnectionFactory.java:868)
     # java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
     # RUBY.new_connection_impl(/home/travis/build/gocardless/hutch/vendor/bundle/jruby/2.2/gems/march_hare-2.18.0-java/lib/march_hare/session.rb:505)
     # RUBY.converting_rjc_exceptions_to_ruby(/home/travis/build/gocardless/hutch/vendor/bundle/jruby/2.2/gems/march_hare-2.18.0-java/lib/march_hare/session.rb:467)
     # RUBY.new_connection_impl(/home/travis/build/gocardless/hutch/vendor/bundle/jruby/2.2/gems/march_hare-2.18.0-java/lib/march_hare/session.rb:500)
     # RUBY.initialize(/home/travis/build/gocardless/hutch/vendor/bundle/jruby/2.2/gems/march_hare-2.18.0-java/lib/march_hare/session.rb:136)
     # RUBY.connect(/home/travis/build/gocardless/hutch/vendor/bundle/jruby/2.2/gems/march_hare-2.18.0-java/lib/march_hare/session.rb:109)
     # RUBY.connect(/home/travis/build/gocardless/hutch/vendor/bundle/jruby/2.2/gems/march_hare-2.18.0-java/lib/march_hare.rb:20)
     # RUBY.initialize(/home/travis/build/gocardless/hutch/lib/hutch/adapters/march_hare.rb:17)
     # RUBY.open_connection(/home/travis/build/gocardless/hutch/lib/hutch/broker.rb:76)
     # RUBY.(root)(/home/travis/build/gocardless/hutch/spec/hutch/broker_spec.rb:89)

https://github.com/newcontext/rabbitmq-java-client/blob/master/src/com/rabbitmq/client/impl/FrameHandlerFactory.java

Tom Enebo stared long at this stracktrace and came up with an explanation

@olleolleolle
Copy link
Contributor Author

@michaelklishin Hi!

Now this long session of trial-and-error is over, and I've learned more about the Travis Matrix system than I care to remember.

I'm a JRuby user, and I'd like it if JRuby was kept a must-work platform for Hutch. I keep up to date with regard to versions.

The fluke build failure that appeared had an explanation (a theory and an explanation) from one of the makers of JRuby.

To counteract that issue, I selected a modern JRuby and ran on Java 8 from Oracle.

What do you say?

@michaelklishin michaelklishin merged commit f57f802 into ruby-amqp:master Sep 21, 2016
@michaelklishin michaelklishin self-assigned this Sep 21, 2016
@michaelklishin
Copy link
Member

Thank you!

@olleolleolle olleolleolle deleted the fix/gemspec-avoid-redcarpet-on-jruby branch September 21, 2016 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants