Commit fe980078 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'test-db-load-balance' into 'master'

Speed up CI job `rspec frontend_fixture` by skipping database load balancing

See merge request gitlab-org/gitlab!71212
parents f474222d 09ec232d
......@@ -115,6 +115,8 @@ update-storybook-yarn-cache:
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets"]
variables:
WEBPACK_VENDOR_DLL: "true"
GITLAB_NO_AR_DB_PREPEND_LOAD_BALANCING: "true"
GITLAB_USE_PREPARED_STATEMENTS: "true"
script:
- run_timed_command "gem install knapsack --no-document"
- run_timed_command "scripts/gitaly-test-spawn"
......
......@@ -2,7 +2,7 @@
ActiveRecord::Base.singleton_class.attr_accessor :load_balancing_proxy
Gitlab::Database.main.disable_prepared_statements
Gitlab::Database.main.disable_prepared_statements unless ENV['GITLAB_USE_PREPARED_STATEMENTS'] == 'true'
Gitlab::Application.configure do |config|
config.middleware.use(Gitlab::Database::LoadBalancing::RackMiddleware)
......@@ -11,7 +11,7 @@ end
# This hijacks the "connection" method to ensure both
# `ActiveRecord::Base.connection` and all models use the same load
# balancing proxy.
ActiveRecord::Base.singleton_class.prepend(Gitlab::Database::LoadBalancing::ActiveRecordProxy)
ActiveRecord::Base.singleton_class.prepend(Gitlab::Database::LoadBalancing::ActiveRecordProxy) unless ENV['GITLAB_NO_AR_DB_PREPEND_LOAD_BALANCING'] == 'true'
# The load balancer needs to be configured immediately, and re-configured after
# forking. This ensures queries that run before forking use the load balancer,
......
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