1
0
Fork 0
mirror of https://github.com/mperham/connection_pool synced 2023-03-27 23:22:21 -04:00
This commit is contained in:
Tamir Duberstein 2015-01-17 22:09:47 -08:00
parent 42c642eac5
commit 67b9e26676

View file

@ -130,21 +130,13 @@ class TestConnectionPool < Minitest::Test
pool = ConnectionPool.new(:timeout => 0, :size => 1) { NetworkConnection.new }
conn = pool.checkout
t1 = Thread.new do
pool.checkout
end
assert_raises Timeout::Error do
t1.join
Thread.new { pool.checkout }.join
end
pool.checkin
t2 = Thread.new do
pool.checkout
end
assert_same conn, t2.value
assert_same conn, Thread.new { pool.checkout }.value
end
def test_returns_value
@ -353,7 +345,7 @@ class TestConnectionPool < Minitest::Test
recorder.do_work("shutdown")
end
assert_equal [[], ["shutdown"], ["shutdown"]], recorders.map { |r| r.calls }.sort
assert_equal [["shutdown"], ["shutdown"], []], recorders.map { |r| r.calls }
pool.checkin