Use lease_connection in in_paginated_batches spec to support permanent_connection_checkout = :disallowed#8958
Conversation
Replace ActiveRecord::Base.connection with ActiveRecord::Base.lease_connection in the in_paginated_batches spec to be compatible with permanent_connection_checkout = :disallowed set in test environment. Co-authored-by: tagliala <[email protected]>
lease_connection in in_paginated_batches spec to support permanent_connection_checkout = :disallowed
Because
The change to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## bugfix/8881-permanent-connection-cherrypick #8958 +/- ##
============================================================================
Coverage 99.08% 99.08%
============================================================================
Files 139 139
Lines 4046 4046
============================================================================
Hits 4009 4009
Misses 37 37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d867eb8
into
bugfix/8881-permanent-connection-cherrypick
…manent_connection_checkout = :disallowed` (#8958) * Initial plan * Fix spec to use lease_connection instead of connection Replace ActiveRecord::Base.connection with ActiveRecord::Base.lease_connection in the in_paginated_batches spec to be compatible with permanent_connection_checkout = :disallowed set in test environment. Co-authored-by: tagliala <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: tagliala <[email protected]>
spec/support/rails_template.rbsetsconfig.active_record.permanent_connection_checkout = :disallowedacross all environments, including test. Thein_paginated_batchesspec was callingActiveRecord::Base.connection.query_cache_enableddirectly, which raises under that setting.Changes
spec/unit/resource_controller/data_access_spec.rb: ReplaceActiveRecord::Base.connectionwithActiveRecord::Base.lease_connection— the Rails 7.2+ API compatible withpermanent_connection_checkout = :disallowed.rails_template.rbis unchanged — thepermanent_connection_checkout = :disallowedconfig intentionally applies to all environments.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.