Skip to content

Commit

Permalink
Add a Toxiproxy test for #549
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Sep 4, 2018
1 parent 15260e6 commit 2f5b355
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/higher_level_api/integration/toxiproxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@
sleep 5
end
end
end

context "recovery attempt limit that's exceeded" do
before(:each) do
setup_toxiproxy
@connection = Bunny.new(user: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed",
host: "localhost:11111", heartbeat_timeout: 1, automatically_recover: true, network_recovery_interval: 1,
recovery_attempts: 3, reset_recovery_attempts_after_reconnection: true)
@connection.start
end

it "permanently closes connection" do
expect(@connection.open?).to be(true)

rabbitmq_toxiproxy.down do
sleep 6
end
# give the connection oen last chance to recover
sleep 3

expect(@connection.closed?).to be(true)
end
end # context
end # describe
else
Expand Down

0 comments on commit 2f5b355

Please sign in to comment.