Commit 7dbcd212 authored by Patrick Bair's avatar Patrick Bair

Merge branch 'fix-ci-decomposed-partitioning' into 'master'

Fix partitioning support for CI decomposed on tests

See merge request gitlab-org/gitlab!69652
parents 8e50c510 507fbcc0
......@@ -151,6 +151,12 @@ namespace :gitlab do
# initializers here as the application can continue to run while
# a rake task reloads the database schema.
Rake::Task['db:test:load'].enhance do
# Due to bug in `db:test:load` if many DBs are used
# the `ActiveRecord::Base.connection` might be switched to another one
# This is due to `if should_reconnect`:
# https://github.com/rails/rails/blob/a81aeb63a007ede2fe606c50539417dada9030c7/activerecord/lib/active_record/railties/databases.rake#L622
ActiveRecord::Base.establish_connection :main
Rake::Task['gitlab:db:create_dynamic_partitions'].invoke
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment