diff --git a/lib/gitlab/exclusive_lease_helpers.rb b/lib/gitlab/exclusive_lease_helpers.rb index da5b0afad389051fcd2079f86e6bf3fa681f9124..7cf0232fbf2de82cc6e1c2a0a7e57c4af0477ede 100644 --- a/lib/gitlab/exclusive_lease_helpers.rb +++ b/lib/gitlab/exclusive_lease_helpers.rb @@ -25,7 +25,7 @@ module ExclusiveLeaseHelpers # a proc that computes the sleep time given the number of preceding attempts # (from 1 to retries - 1) # - # Note: It's basically discouraged to use this method in a unicorn thread, + # Note: It's basically discouraged to use this method in a webserver thread, # because this ties up all thread related resources until all `retries` are consumed. # This could potentially eat up all connection pools. def in_lock(key, ttl: 1.minute, retries: 10, sleep_sec: 0.01.seconds) diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index a8d42f4bccfad02cf70f46b5731d776a162759ec..16f75691288b3e1ab7ca9d5ef1f890d101f70e4b 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -33,14 +33,6 @@ def stub_repos_storages(address) it { expect(subject.long_timeout).to eq(6.hours) } end - context 'running in Unicorn' do - before do - allow(Gitlab::Runtime).to receive(:unicorn?).and_return(true) - end - - it { expect(subject.long_timeout).to eq(55) } - end - context 'running in Puma' do before do allow(Gitlab::Runtime).to receive(:puma?).and_return(true) diff --git a/spec/lib/gitlab/runtime_spec.rb b/spec/lib/gitlab/runtime_spec.rb index 0fcb7db7d5f1a44f9d6a115ed02f5623b205758d..f51c5dd3d2045013f1fd47b228f429ff4270c909 100644 --- a/spec/lib/gitlab/runtime_spec.rb +++ b/spec/lib/gitlab/runtime_spec.rb @@ -99,25 +99,6 @@ end end - context "unicorn" do - before do - stub_const('::Unicorn', Module.new) - stub_const('::Unicorn::HttpServer', Class.new) - stub_env('ACTION_CABLE_IN_APP', 'false') - end - - it_behaves_like "valid runtime", :unicorn, 1 - - context "when ActionCable in-app mode is enabled" do - before do - stub_env('ACTION_CABLE_IN_APP', 'true') - stub_env('ACTION_CABLE_WORKER_POOL_SIZE', '3') - end - - it_behaves_like "valid runtime", :unicorn, 4 - end - end - context "sidekiq" do let(:sidekiq_type) { double('::Sidekiq') } diff --git a/spec/lib/gitlab/usage_data/topology_spec.rb b/spec/lib/gitlab/usage_data/topology_spec.rb index b8462e0290cbdac3acc09959a2dbc405d3880419..737580e349333aca44c75f2c93e47854e26a5ea7 100644 --- a/spec/lib/gitlab/usage_data/topology_spec.rb +++ b/spec/lib/gitlab/usage_data/topology_spec.rb @@ -95,7 +95,7 @@ }, { name: 'web', - server: 'unicorn' + server: 'puma' } ] } @@ -724,7 +724,7 @@ def receive_node_service_app_server_workers_query(result: nil) }, # instance 2 { - 'metric' => { 'instance' => 'instance2:8080', 'job' => 'gitlab-rails', 'server' => 'unicorn' }, + 'metric' => { 'instance' => 'instance2:8080', 'job' => 'gitlab-rails', 'server' => 'puma' }, 'value' => [1000, '1'] } ]) diff --git a/spec/requests/api/terraform/state_spec.rb b/spec/requests/api/terraform/state_spec.rb index 2cb3c8e9ab5714f70daec64f5316a941e8f02618..27cdd0250486f8f16c606e5b0f5bc38c6271e885 100644 --- a/spec/requests/api/terraform/state_spec.rb +++ b/spec/requests/api/terraform/state_spec.rb @@ -156,15 +156,6 @@ expect(response).to have_gitlab_http_status(:ok) expect(Gitlab::Json.parse(response.body)).to be_empty end - - context 'on Unicorn', :unicorn do - it 'updates the state' do - expect { request }.to change { Terraform::State.count }.by(0) - - expect(response).to have_gitlab_http_status(:ok) - expect(Gitlab::Json.parse(response.body)).to be_empty - end - end end context 'without body' do @@ -200,15 +191,6 @@ expect(response).to have_gitlab_http_status(:ok) expect(Gitlab::Json.parse(response.body)).to be_empty end - - context 'on Unicorn', :unicorn do - it 'creates a new state' do - expect { request }.to change { Terraform::State.count }.by(1) - - expect(response).to have_gitlab_http_status(:ok) - expect(Gitlab::Json.parse(response.body)).to be_empty - end - end end context 'without body' do diff --git a/spec/support/shared_examples/requests/api/conan_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/conan_packages_shared_examples.rb index c938c6432fe528dc3ad142cd2c2a68122a52bd53..20606ae942d4b8b515161e18d350d72292acd926 100644 --- a/spec/support/shared_examples/requests/api/conan_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/conan_packages_shared_examples.rb @@ -294,16 +294,6 @@ end end -RSpec.shared_examples 'successful response when using Unicorn' do - context 'on Unicorn', :unicorn do - it 'returns successfully' do - subject - - expect(response).to have_gitlab_http_status(:ok) - end - end -end - RSpec.shared_examples 'recipe snapshot endpoint' do subject { get api(url), headers: headers } @@ -372,7 +362,6 @@ it_behaves_like 'rejects invalid recipe' it_behaves_like 'rejects invalid upload_url params' - it_behaves_like 'successful response when using Unicorn' it 'returns a set of upload urls for the files requested' do subject @@ -434,7 +423,6 @@ it_behaves_like 'rejects invalid recipe' it_behaves_like 'rejects invalid upload_url params' - it_behaves_like 'successful response when using Unicorn' it 'returns a set of upload urls for the files requested' do expected_response = { diff --git a/spec/support/unicorn.rb b/spec/support/unicorn.rb deleted file mode 100644 index 0b01fc9e26caa83dffb64b64c123308dc68b535e..0000000000000000000000000000000000000000 --- a/spec/support/unicorn.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -REQUEST_CLASSES = [ - ::Grape::Request, - ::Rack::Request -].freeze - -def request_body_class - return ::Unicorn::TeeInput if defined?(::Unicorn) - - Class.new(StringIO) do - def string - raise NotImplementedError, '#string is only valid under Puma which uses StringIO, use #read instead' - end - end -end - -RSpec.configure do |config| - config.before(:each, :unicorn) do - REQUEST_CLASSES.each do |request_class| - allow_any_instance_of(request_class) - .to receive(:body).and_wrap_original do |m, *args| - request_body_class.new(m.call(*args).read) - end - end - end -end