Sha256: 7f9212eb023d7d0c43dff49c702f9c04d5f217c7a883f315b03e3caa4bc753b8

Contents?: true

Size: 1007 Bytes

Versions: 52

Compression:

Stored size: 1007 Bytes

Contents

# encoding: utf-8

require "spec_helper"

# this example group ensures no message size is special
# (with respect to framing edge cases). MK.
describe "Stress test with messages with incrementing sizes" do

  #
  # Environment
  #

  include EventedSpec::AMQPSpec
  default_options AMQP_OPTS
  default_timeout 60

  amqp_before do
    @channel   = AMQP::Channel.new
    @channel.on_error do |ch, close|
      raise "Channel-level error!: #{close.inspect}"
    end

    @queue    = @channel.queue("", :auto_delete => true)
    @exchange = @channel.fanout("amqpgem.tests.integration.fanout.exchange", :auto_delete => true)

    @queue.bind(@exchange)
  end


  #
  # Examples
  #

  it "passes" do
    list     = Range.new(0, 4785).to_a
    received = Array.new

    @queue.subscribe do |metadata, payload|
      received << payload.bytesize

      done if received == list
    end

    EventMachine.add_timer(1.0) do
      list.each do |n|
        @exchange.publish("i" * n)
      end      
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
amqp-1.8.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.7.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.6.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.5.3 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.5.2 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.5.1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.5.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.4.2 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.4.1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.4.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.3.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.2.1 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.2.0 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.8 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.7 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.6 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.5 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.4 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.1.3 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
amqp-1.0.4 spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb