From bdf3da8f80b7dc32dd90e1d3673c273f65eae5b9 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 11 Jul 2018 09:54:01 +0800 Subject: [PATCH] DEV: Raise an error if any test finishes with more than 1 busy AR connection. --- spec/rails_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 96495386b61..0bd62cd22b0 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -133,6 +133,8 @@ RSpec.configure do |config| end unfreeze_time + + raise if ActiveRecord::Base.connection_pool.stat[:busy] > 1 end config.before :each do |x|