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