提交 657095d8 编写于 作者: A Aaron Patterson

ensure that released connections move between threads

上级 d523504c
......@@ -31,6 +31,24 @@ def active_connections(pool)
pool.connections.find_all(&:in_use?)
end
def test_released_connection_moves_between_threads
thread_conn = nil
Thread.new {
pool.with_connection do |conn|
thread_conn = conn
end
}.join
assert thread_conn
Thread.new {
pool.with_connection do |conn|
assert_equal thread_conn, conn
end
}.join
end
def test_with_connection
assert_equal 0, active_connections(pool).size
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册