Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-27 03:08:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-27 03:08:19 +0300
commitc937ca4f20d47f5cc87300eae29dbb98ad0a956c (patch)
tree761a8febb2e27f7ac1a04c8f077546125818e546 /spec/tasks
parent972f10aa90a29b400ee84ee66e720ec633102b33 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/dev_rake_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/tasks/dev_rake_spec.rb b/spec/tasks/dev_rake_spec.rb
index fa093db414f..41728faa0e0 100644
--- a/spec/tasks/dev_rake_spec.rb
+++ b/spec/tasks/dev_rake_spec.rb
@@ -50,6 +50,10 @@ RSpec.describe 'dev rake tasks' do
end
describe 'terminate_all_connections' do
+ before do
+ allow(ActiveRecord::Base).to receive(:clear_all_connections!)
+ end
+
let(:connections) do
Gitlab::Database.database_base_models.values.filter_map do |model|
model.connection if Gitlab::Database.db_config_share_with(model.connection_db_config).nil?
@@ -75,6 +79,8 @@ RSpec.describe 'dev rake tasks' do
it 'terminates all connections' do
expect_connections_to_be_terminated
+ expect(ActiveRecord::Base).to receive(:clear_all_connections!)
+
terminate_task
end
@@ -82,6 +88,7 @@ RSpec.describe 'dev rake tasks' do
it 'does not terminate connections' do
expect(Rails.env).to receive(:production?).and_return(true)
expect_connections_not_to_be_terminated
+ expect(ActiveRecord::Base).not_to receive(:clear_all_connections!)
terminate_task
end