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>2020-01-16 06:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 06:08:47 +0300
commit08ed6a867b690a04fe7a74c9ba697cf18f6107d7 (patch)
tree9561a9aeee9a57cec168b143a76e6f65fd92ae0b /spec/lib/gitlab/runtime_spec.rb
parentb0f27742e78a4aa4208c271536b6b9d84c53b49e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/runtime_spec.rb')
-rw-r--r--spec/lib/gitlab/runtime_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/lib/gitlab/runtime_spec.rb b/spec/lib/gitlab/runtime_spec.rb
index 6059644a1b2..194ed49bb32 100644
--- a/spec/lib/gitlab/runtime_spec.rb
+++ b/spec/lib/gitlab/runtime_spec.rb
@@ -26,9 +26,15 @@ describe Gitlab::Runtime do
context "puma" do
let(:puma_type) { double('::Puma') }
+ let(:options) do
+ {
+ max_threads: 2
+ }
+ end
before do
stub_const('::Puma', puma_type)
+ allow(puma_type).to receive_message_chain(:cli_config, :options).and_return(options)
end
it "identifies itself" do
@@ -43,6 +49,10 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(2)
+ end
end
context "unicorn" do
@@ -66,14 +76,24 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(1)
+ end
end
context "sidekiq" do
let(:sidekiq_type) { double('::Sidekiq') }
+ let(:options) do
+ {
+ concurrency: 2
+ }
+ end
before do
stub_const('::Sidekiq', sidekiq_type)
allow(sidekiq_type).to receive(:server?).and_return(true)
+ allow(sidekiq_type).to receive(:options).and_return(options)
end
it "identifies itself" do
@@ -88,6 +108,10 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(2)
+ end
end
context "console" do
@@ -109,6 +133,10 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.rspec?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(1)
+ end
end
context "rspec" do
@@ -127,5 +155,9 @@ describe Gitlab::Runtime do
expect(subject.rake?).to be(false)
expect(subject.puma?).to be(false)
end
+
+ it "reports its maximum concurrency" do
+ expect(subject.max_threads).to eq(1)
+ end
end
end