Skip to content

Disable forced reconnection in tests

Stan Hu requested to merge sh-disable-force-reconnections-in-tests into master

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.

Edited by Stan Hu

Merge request reports

Loading