diff options
author | Matthew Draper <matthew@trebex.net> | 2019-03-05 01:40:36 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2019-03-05 02:02:41 +1030 |
commit | 99d84c6ab288788b85c0c3603d4630b39cf29ed0 (patch) | |
tree | ee677f7ae7f2683f4cc4528e3f3180179c961583 /activerecord/test/cases | |
parent | af986325e9da4f6c446b9adb62058e82b33cc8d4 (diff) | |
download | rails-99d84c6ab288788b85c0c3603d4630b39cf29ed0.tar.gz rails-99d84c6ab288788b85c0c3603d4630b39cf29ed0.tar.bz2 rails-99d84c6ab288788b85c0c3603d4630b39cf29ed0.zip |
Clean up AR's isolated test runner
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/unconnected_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/unconnected_test.rb b/activerecord/test/cases/unconnected_test.rb index f0a0e7f805..49746996bc 100644 --- a/activerecord/test/cases/unconnected_test.rb +++ b/activerecord/test/cases/unconnected_test.rb @@ -11,6 +11,12 @@ class TestUnconnectedAdapter < ActiveRecord::TestCase def setup @underlying = ActiveRecord::Base.connection @specification = ActiveRecord::Base.remove_connection + + # Clear out connection info from other pids (like a fork parent) too + pool_map = ActiveRecord::Base.connection_handler.instance_variable_get(:@owner_to_pool) + (pool_map.keys - [Process.pid]).each do |other_pid| + pool_map.delete(other_pid) + end end teardown do |