diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-15 12:17:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-15 12:17:01 +0300 |
commit | e7e44c0e4ce493bb103b0fd98f8dd3c90928d291 (patch) | |
tree | 3145dea916e51dac9adcfd3d4639eaf27efe0f1e /spec/commands | |
parent | 66fc7ba6f3a4a8e74529192f1dd110d87a91fdfb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/commands')
-rw-r--r-- | spec/commands/metrics_server/metrics_server_spec.rb | 8 | ||||
-rw-r--r-- | spec/commands/sidekiq_cluster/cli_spec.rb | 20 |
2 files changed, 11 insertions, 17 deletions
diff --git a/spec/commands/metrics_server/metrics_server_spec.rb b/spec/commands/metrics_server/metrics_server_spec.rb index 3b92c3c38fa..217aa185767 100644 --- a/spec/commands/metrics_server/metrics_server_spec.rb +++ b/spec/commands/metrics_server/metrics_server_spec.rb @@ -38,13 +38,7 @@ RSpec.describe 'bin/metrics-server', :aggregate_failures do config_file.write(YAML.dump(config)) config_file.close - env = { - 'GITLAB_CONFIG' => config_file.path, - 'METRICS_SERVER_TARGET' => target, - 'WIPE_METRICS_DIR' => '1', - 'prometheus_multiproc_dir' => metrics_dir - } - @pid = Process.spawn(env, 'bin/metrics-server', pgroup: true) + @pid = MetricsServer.spawn(target, metrics_dir: metrics_dir, gitlab_config: config_file.path, wipe_metrics_dir: true) end after do diff --git a/spec/commands/sidekiq_cluster/cli_spec.rb b/spec/commands/sidekiq_cluster/cli_spec.rb index 4d4e1f35cff..15b738cacd1 100644 --- a/spec/commands/sidekiq_cluster/cli_spec.rb +++ b/spec/commands/sidekiq_cluster/cli_spec.rb @@ -303,7 +303,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo end it 'does not start a sidekiq metrics server' do - expect(MetricsServer).not_to receive(:spawn) + expect(MetricsServer).not_to receive(:fork) cli.run(%w(foo)) end @@ -320,7 +320,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo end it 'does not start a sidekiq metrics server' do - expect(MetricsServer).not_to receive(:spawn) + expect(MetricsServer).not_to receive(:fork) cli.run(%w(foo)) end @@ -350,7 +350,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo end it 'does not start a sidekiq metrics server' do - expect(MetricsServer).not_to receive(:spawn) + expect(MetricsServer).not_to receive(:fork) cli.run(%w(foo)) end @@ -376,7 +376,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo end it 'does not start a sidekiq metrics server' do - expect(MetricsServer).not_to receive(:spawn) + expect(MetricsServer).not_to receive(:fork) cli.run(%w(foo)) end @@ -406,9 +406,9 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo specify do if start_metrics_server - expect(MetricsServer).to receive(:spawn).with('sidekiq', metrics_dir: metrics_dir, wipe_metrics_dir: true, trapped_signals: trapped_signals) + expect(MetricsServer).to receive(:fork).with('sidekiq', metrics_dir: metrics_dir, wipe_metrics_dir: true, reset_signals: trapped_signals) else - expect(MetricsServer).not_to receive(:spawn) + expect(MetricsServer).not_to receive(:fork) end cli.run(%w(foo)) @@ -421,7 +421,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo let(:sidekiq_exporter_enabled) { true } it 'does not start the server' do - expect(MetricsServer).not_to receive(:spawn) + expect(MetricsServer).not_to receive(:fork) cli.run(%w(foo --dryrun)) end @@ -434,7 +434,7 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo before do allow(cli).to receive(:sleep).with(a_kind_of(Numeric)) - allow(MetricsServer).to receive(:spawn).and_return(99) + allow(MetricsServer).to receive(:fork).and_return(99) cli.start_metrics_server end @@ -453,8 +453,8 @@ RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubo allow(Gitlab::ProcessManagement).to receive(:all_alive?).with(an_instance_of(Array)).and_return(false) allow(cli).to receive(:stop_metrics_server) - expect(MetricsServer).to receive(:spawn).with( - 'sidekiq', metrics_dir: metrics_dir, wipe_metrics_dir: false, trapped_signals: trapped_signals + expect(MetricsServer).to receive(:fork).with( + 'sidekiq', metrics_dir: metrics_dir, wipe_metrics_dir: false, reset_signals: trapped_signals ) cli.start_loop |