Sha256: b8739644af498cc4f4d6198bd431e5b1c43f65df149a1953f0c7d26218570ede

Contents?: true

Size: 1.26 KB

Versions: 30

Compression:

Stored size: 1.26 KB

Contents

require "spec_helper"

unless defined?(JRUBY_VERSION) && !ENV["FORCE_JRUBY_RUN"]
  describe Bunny::Session do
    # creating thousands of connections means creating
    # twice as many threads and this won't fly with the JVM
    # in CI containers. MK.
    n = if defined?(JRUBY_VERSION)
          250
        else
          2500
        end

    n.times do |i|
      it "can be closed (automatic recovery disabled, take #{i})" do
        c  = Bunny.new(automatically_recover: false)
        c.start
        ch = c.create_channel

        expect(c).to be_connected
        c.stop
        expect(c).to be_closed
      end
    end

    n.times do |i|
      it "can be closed (automatic recovery enabled, take #{i})" do
        c  = Bunny.new(automatically_recover: true)
        c.start
        ch = c.create_channel

        expect(c).to be_connected
        c.stop
        expect(c).to be_closed
      end
    end

    context "in the single threaded mode" do
      n.times do |i|
        it "can be closed (single threaded mode, take #{i})" do
          c  = Bunny.new(automatically_recover: false, threaded: false)
          c.start
          ch = c.create_channel

          expect(c).to be_connected
          c.stop
          expect(c).to be_closed
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
bunny-2.19.0 spec/stress/connection_open_close_spec.rb
bunny-2.18.0 spec/stress/connection_open_close_spec.rb
bunny-2.17.0 spec/stress/connection_open_close_spec.rb
bunny-2.16.1 spec/stress/connection_open_close_spec.rb
bunny-2.15.0 spec/stress/connection_open_close_spec.rb
bunny-2.14.4 spec/stress/connection_open_close_spec.rb
bunny-2.14.3 spec/stress/connection_open_close_spec.rb
bunny-2.14.2 spec/stress/connection_open_close_spec.rb
bunny-2.14.1 spec/stress/connection_open_close_spec.rb
bunny-2.13.0 spec/stress/connection_open_close_spec.rb
bunny-2.12.1 spec/stress/connection_open_close_spec.rb
bunny-2.12.0 spec/stress/connection_open_close_spec.rb
bunny-2.12.0.rc1 spec/stress/connection_open_close_spec.rb
bunny-2.11.0 spec/stress/connection_open_close_spec.rb
bunny-2.11.0.pre1 spec/stress/connection_open_close_spec.rb
bunny-2.10.0 spec/stress/connection_open_close_spec.rb
bunny-2.9.2 spec/stress/connection_open_close_spec.rb
bunny-2.9.1 spec/stress/connection_open_close_spec.rb
bunny-2.6.7 spec/stress/connection_open_close_spec.rb
bunny-2.7.4 spec/stress/connection_open_close_spec.rb