diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-14 18:11:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-14 18:11:00 +0300 |
commit | 1ab98e892c57b409d5ac3d643fdebc93de5a08dc (patch) | |
tree | 37b81d604a3b0fece0b9ee6c59e106f923322ca2 /spec/initializers | |
parent | a0d49dc011304985a8fd8a7ab337c003995c8ae1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/initializers')
-rw-r--r-- | spec/initializers/diagnostic_reports_spec.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/spec/initializers/diagnostic_reports_spec.rb b/spec/initializers/diagnostic_reports_spec.rb index 9eb240e1c0a..01b1ed9b7b5 100644 --- a/spec/initializers/diagnostic_reports_spec.rb +++ b/spec/initializers/diagnostic_reports_spec.rb @@ -43,43 +43,6 @@ RSpec.describe 'diagnostic reports' do load_initializer end - - context 'with `Gitlab::Memory::UploadAndCleanupReports` added into initializer' do - before do - allow(Gitlab::Memory::ReportsDaemon).to receive(:instance).and_return(report_daemon) - allow(report_daemon).to receive(:start) - end - - context 'when run from `puma_0` worker process' do - let(:uploader) { instance_double(Gitlab::Memory::UploadAndCleanupReports) } - let(:background_task) { instance_double(Gitlab::BackgroundTask) } - - before do - allow(Prometheus::PidProvider).to receive(:worker_id).and_return('puma_0') - end - - it 'sets up `Gitlab::Memory::UploadAndCleanupReports` as `BackgroundTask`' do - expect(Gitlab::Memory::UploadAndCleanupReports).to receive(:new).and_return(uploader) - expect(Gitlab::BackgroundTask).to receive(:new).with(uploader).and_return(background_task) - expect(background_task).to receive(:start) - - load_initializer - end - end - - context 'when run from worker process other than `puma_0`' do - before do - allow(Prometheus::PidProvider).to receive(:worker_id).and_return('puma_1') - end - - it 'does not set up `Gitlab::Memory::UploadAndCleanupReports`' do - expect(Gitlab::Memory::UploadAndCleanupReports).not_to receive(:new) - expect(Gitlab::BackgroundTask).not_to receive(:new) - - load_initializer - end - end - end end context 'when run in non-Puma context, such as rails console, tests, Sidekiq' do |