Skip to content

Commit

Permalink
Further improve resource cleanup in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Feb 23, 2025
1 parent 2bb1aaf commit 5543c40
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
it "recovers client-named queues" do
with_open do |c|
ch = c.create_channel
q = ch.queue("bunny.tests.recovery.client-named#{rand}", durable: false)
q = ch.queue("bunny.tests.recovery.client-named#{rand}", durable: false, exclusive: true)
close_all_connections!
wait_for_recovery_with { connections.any? }
expect(ch).to be_open
Expand Down
2 changes: 1 addition & 1 deletion spec/higher_level_api/integration/queue_declare_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
context "when a queue exists" do
it "returns true" do
ch = connection.create_channel
q = ch.queue("bunny.tests.queues.exists")
q = ch.queue("bunny.tests.queues.exists", durable: true, arguments: {"x-expires" => 5000})

expect(connection.queue_exists?(q.name)).to eq true
end
Expand Down
6 changes: 6 additions & 0 deletions spec/higher_level_api/integration/read_only_consumer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@

expect(ch.queue(queue_name, auto_delete: true, durable: false).message_count).to eq 0

c3 = Bunny::new
c3.start
ch3 = c3.create_channel
ch3.queue_delete(queue_name)

ch.close
ch3.close
end
end
end # describe

0 comments on commit 5543c40

Please sign in to comment.