summaryrefslogtreecommitdiff
path: root/spec/lib/backup/repositories_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /spec/lib/backup/repositories_spec.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/lib/backup/repositories_spec.rb')
-rw-r--r--spec/lib/backup/repositories_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/lib/backup/repositories_spec.rb b/spec/lib/backup/repositories_spec.rb
index d77b1e0f276..85818038c9d 100644
--- a/spec/lib/backup/repositories_spec.rb
+++ b/spec/lib/backup/repositories_spec.rb
@@ -4,7 +4,8 @@ require 'spec_helper'
RSpec.describe Backup::Repositories do
let(:progress) { spy(:stdout) }
- let(:strategy) { spy(:strategy) }
+ let(:parallel_enqueue) { true }
+ let(:strategy) { spy(:strategy, parallel_enqueue?: parallel_enqueue) }
subject { described_class.new(progress, strategy: strategy) }
@@ -80,6 +81,22 @@ RSpec.describe Backup::Repositories do
end
end
+ context 'concurrency with a strategy without parallel enqueueing support' do
+ let(:parallel_enqueue) { false }
+
+ it 'enqueues all projects sequentially' do
+ expect(Thread).not_to receive(:new)
+
+ expect(strategy).to receive(:start).with(:create)
+ projects.each do |project|
+ expect(strategy).to receive(:enqueue).with(project, Gitlab::GlRepository::PROJECT)
+ end
+ expect(strategy).to receive(:wait)
+
+ subject.dump(max_concurrency: 2, max_storage_concurrency: 2)
+ end
+ end
+
[4, 10].each do |max_storage_concurrency|
context "max_storage_concurrency #{max_storage_concurrency}", quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/241701' do
let(:storage_keys) { %w[default test_second_storage] }