aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-07-07 07:40:26 +0930
committerGitHub <noreply@github.com>2016-07-07 07:40:26 +0930
commitaeba05d389a846908cedbafa3a82eb781ae0f19d (patch)
tree51538a6aabc93247cef3da4bb0d70a47014ae5ec /activerecord/test
parentd5ca0a8b8e4a9ab301ba37a335e62ada872e7a76 (diff)
parent61f4b1ff8a54ccd7e70bb4f6c0b958b28bc648fc (diff)
downloadrails-aeba05d389a846908cedbafa3a82eb781ae0f19d.tar.gz
rails-aeba05d389a846908cedbafa3a82eb781ae0f19d.tar.bz2
rails-aeba05d389a846908cedbafa3a82eb781ae0f19d.zip
Merge pull request #25707 from matthewd/double-reap
Don't reap connections that have already been reassigned
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/connection_pool_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb
index a45ee281c7..09e7848bda 100644
--- a/activerecord/test/cases/connection_pool_test.rb
+++ b/activerecord/test/cases/connection_pool_test.rb
@@ -151,7 +151,7 @@ module ActiveRecord
assert_equal 1, active_connections(@pool).size
ensure
- @pool.connections.each(&:close)
+ @pool.connections.each { |conn| conn.close if conn.in_use? }
end
def test_remove_connection
@@ -432,6 +432,9 @@ module ActiveRecord
Thread.new { @pool.send(group_action_method) }.join
# assert connection has been forcefully taken away from us
assert_not @pool.active_connection?
+
+ # make a new connection for with_connection to clean up
+ @pool.connection
end
end
end