Disable forced reconnection in tests
What does this MR do and why?
We found that if tests run for longer than an hour, the patch
introduced in f255054c to force a reconnection of database connections
after a check-in interferes with tests that rely on let_it_be
.
let_it_be
values are set in the before
block and expect
the current PostgreSQL transaction to remain open. However this
forced reconnection will cause a new PostgreSQL connection
to be established and will cause specs to fail.
Since it's not normal for processes to call
ActiveRecord::Base.clear_active_connections!
with an open
transaction, disable this force reconnection by setting
force_reconnect_interval
to a negative value.
Relates to #418757 (closed)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.