diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/connection_pool_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb index 6300011f4a..c0d5e3707c 100644 --- a/activerecord/test/cases/connection_pool_test.rb +++ b/activerecord/test/cases/connection_pool_test.rb @@ -1,4 +1,5 @@ require "cases/helper" +require 'active_support/concurrency/latch' module ActiveRecord module ConnectionAdapters @@ -133,15 +134,15 @@ module ActiveRecord end def test_reap_inactive - ready = false + ready = ActiveSupport::Concurrency::Latch.new @pool.checkout child = Thread.new do @pool.checkout @pool.checkout - ready = true + ready.release Thread.stop end - Thread.pass until ready + ready.await assert_equal 3, active_connections(@pool).size |