Skip to content

Commit 6868418

Browse files
committed
Fix connection pool leaking between test cases
1 parent c0f2229 commit 6868418

File tree

1 file changed

+5
-0
lines changed
  • spec/datadog/tracing/contrib/rails/support

1 file changed

+5
-0
lines changed

spec/datadog/tracing/contrib/rails/support/base.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
end
1515

1616
after do
17+
# NOTE: We forsibly close connection pool to avoid leaking connection between
18+
# test cases.
19+
# This call is safe to be used on already closed connection pool.
20+
application_record&.connection&.disconnect! if application_record&.connected?
21+
1722
# Reset references stored in the Rails class
1823
Rails.application = nil
1924
Rails.logger = nil

0 commit comments

Comments
 (0)