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>2021-11-18 15:13:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 15:13:46 +0300
commit9796aa22cd601f03101402540f41a05ad71828e5 (patch)
treeaf5934ea6156c4b31fd67bb7f5bd3a3de86b35fd /spec/sidekiq_cluster
parentf7e83434e312ca6cf598c6d815fe32dc200e3056 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/sidekiq_cluster')
-rw-r--r--spec/sidekiq_cluster/sidekiq_cluster_spec.rb29
1 files changed, 18 insertions, 11 deletions
diff --git a/spec/sidekiq_cluster/sidekiq_cluster_spec.rb b/spec/sidekiq_cluster/sidekiq_cluster_spec.rb
index 3df2aa70553..86b3fc6a48c 100644
--- a/spec/sidekiq_cluster/sidekiq_cluster_spec.rb
+++ b/spec/sidekiq_cluster/sidekiq_cluster_spec.rb
@@ -7,19 +7,26 @@ require_relative '../../sidekiq_cluster/sidekiq_cluster'
RSpec.describe Gitlab::SidekiqCluster do # rubocop:disable RSpec/FilePath
describe '.start' do
it 'starts Sidekiq with the given queues, environment and options' do
- expected_options = {
- env: :production,
- directory: 'foo/bar',
- max_concurrency: 20,
- min_concurrency: 10,
- timeout: 25,
- dryrun: true
+ process_options = {
+ pgroup: true,
+ err: $stderr,
+ out: $stdout
}
- expect(described_class).to receive(:start_sidekiq).ordered.with(%w(foo), expected_options.merge(worker_id: 0))
- expect(described_class).to receive(:start_sidekiq).ordered.with(%w(bar baz), expected_options.merge(worker_id: 1))
-
- described_class.start([%w(foo), %w(bar baz)], env: :production, directory: 'foo/bar', max_concurrency: 20, min_concurrency: 10, dryrun: true)
+ expect(Process).to receive(:spawn).ordered.with({
+ "ENABLE_SIDEKIQ_CLUSTER" => "1",
+ "SIDEKIQ_WORKER_ID" => "0"
+ },
+ "bundle", "exec", "sidekiq", "-c10", "-eproduction", "-t25", "-gqueues:foo", "-rfoo/bar", "-qfoo,1", process_options
+ )
+ expect(Process).to receive(:spawn).ordered.with({
+ "ENABLE_SIDEKIQ_CLUSTER" => "1",
+ "SIDEKIQ_WORKER_ID" => "1"
+ },
+ "bundle", "exec", "sidekiq", "-c10", "-eproduction", "-t25", "-gqueues:bar,baz", "-rfoo/bar", "-qbar,1", "-qbaz,1", process_options
+ )
+
+ described_class.start([%w(foo), %w(bar baz)], env: :production, directory: 'foo/bar', max_concurrency: 20, min_concurrency: 10)
end
it 'starts Sidekiq with the given queues and sensible default options' do