aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/unconnected_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/unconnected_test.rb')
-rw-r--r--activerecord/test/cases/unconnected_test.rb6
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