diff options
author | Devin Christensen <quixoten@gmail.com> | 2017-04-13 13:56:42 -0600 |
---|---|---|
committer | Devin Christensen <quixoten@gmail.com> | 2017-04-13 13:56:42 -0600 |
commit | 6116d7bc052839646f448b8403a7287f52b97ed7 (patch) | |
tree | ae08d005831f354e404664af038ded259fd0f824 /activerecord/test/cases | |
parent | 3360742396a00c9e2ff9838373788bed432d5ea7 (diff) | |
download | rails-6116d7bc052839646f448b8403a7287f52b97ed7.tar.gz rails-6116d7bc052839646f448b8403a7287f52b97ed7.tar.bz2 rails-6116d7bc052839646f448b8403a7287f52b97ed7.zip |
Improve documentation and add test
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/connection_pool_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb index 7e88c9cf7a..46081cc13d 100644 --- a/activerecord/test/cases/connection_pool_test.rb +++ b/activerecord/test/cases/connection_pool_test.rb @@ -203,6 +203,14 @@ module ActiveRecord end.join end + def test_checkout_order_is_fifo + conn1 = @pool.checkout + conn2 = @pool.checkout + @pool.checkin conn1 + @pool.checkin conn2 + assert_equal [conn2, conn1], 2.times.map { @pool.checkout } + end + # The connection pool is "fair" if threads waiting for # connections receive them in the order in which they began # waiting. This ensures that we don't timeout one HTTP request |