Skip to content

Add `#with_reestablished_active_record_base` to allow usage of `establish_connection`

Kamil Trzciński requested to merge fix-establish_connection-in-specs into master

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.

Edited by Kamil Trzciński

Merge request reports