jemc / ruby-rabbitmq

A Ruby RabbitMQ client library based on FFI bindings for librabbitmq. :gem: :rabbit2:
MIT License
10 stars 7 forks source link

Add DEFAULT_EXCHANGE and AVAILABILITY_ERRORS constants #2

Closed amclain closed 8 years ago

amclain commented 8 years ago

This PR adds the DEFAULT_EXCHANGE and AVAILABILITY_ERRORS constants we discussed.

Just FYI, this test was failing on master before I started the work, and is still failing:

RabbitMQ::Channel .........................
RabbitMQ::Client::Connection .............
RabbitMQ::Client F..........................................

  1) RabbitMQ::Client closes itself from server-sent connection error closure
     Failure/Error:
       expect {
         subject.send_request(11, :channel_open)
         subject.fetch_response(11, :channel_open_ok)
       }.to raise_error RabbitMQ::ServerError::ConnectionError::CommandInvalid

       expected RabbitMQ::ServerError::ConnectionError::CommandInvalid, got #<RabbitMQ::ServerError::ConnectionError::ChannelError: CHANNEL_ERROR - second 'channel.open' seen> with backtrace:
         # ./lib/rabbitmq/client.rb:297:in `raise_if_server_error!'
         # ./lib/rabbitmq/client.rb:282:in `store_incoming_event'
         # ./lib/rabbitmq/client.rb:322:in `fetch_response_internal'
         # ./lib/rabbitmq/client.rb:128:in `fetch_response'
         # ./spec/client_spec.rb:107:in `block (3 levels) in <top (required)>'
         # ./spec/client_spec.rb:105:in `block (2 levels) in <top (required)>'
     # ./spec/client_spec.rb:105:in `block (2 levels) in <top (required)>'
RabbitMQ::FFI .....
RabbitMQ ..
RabbitMQ::Util ..........

Finished in 1.73 seconds (files took 0.24652 seconds to load)
98 examples, 1 failure
jemc commented 8 years ago

Thanks for the PR.

Regarding the failure you saw locally - I think it might be the case that different versions of RabbitMQ raise different errors for that condition. Which would mean that this test isn't valid for all versions of RabbitMQ, so I should either remove the test or take the time to set up a rake task to set up a specific version of RabbitMQ in a docker container, available for testing. This latter would probably be the better option.

It looks like the CI failure is unrelated to either this PR or the outstanding issue you had (it's missing the right version of rake, and needs a bundle install thrown in somewhere).