Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/async/pool/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,19 @@ def failures(repeats: 500, time_scale: 0.001, &block)
pool.close
end
end

with "cancellation while waiting" do
it "cancels the gardener when closing the pool" do
# Regression test for https://bugs.ruby-lang.org/issues/20907.
# Allocating a resource starts the gardener, which then parks in `#wait`:
resource = pool.acquire
gardener = pool.instance_variable_get(:@gardener)
pool.release(resource)

# This stops the gardener while it is waiting:
pool.close

expect(gardener.wait).to be_nil
end
end
end
Loading