Add `#with_reestablished_active_record_base` to allow usage of `establish_connection`
What does this MR do and why?
This allows to safely modify connections via establish_connection
without affecting the systems state which might result in a flakky
behavior of tests:
- transactions might be rolledback resulting in modifying global state
-
remove_connection
might result in removing a current connection with currently open transactions -
establish_connection
might change pool sizes, connection names, and other parameters of established connections - connections might be orphaned in some cases
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.
Edited by Kamil Trzciński