diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-10 15:15:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-10 15:15:34 +0300 |
commit | d85be261b2898166676be4f329a548f61e2917f4 (patch) | |
tree | 393faefd792483f15860dd184b524ac597295ae1 /spec/commands | |
parent | 75330c963b9e949443b1e4ab2e5770879d395158 (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 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/commands/metrics_server/metrics_server_spec.rb b/spec/commands/metrics_server/metrics_server_spec.rb index f3936e6b346..b755801bb65 100644 --- a/spec/commands/metrics_server/metrics_server_spec.rb +++ b/spec/commands/metrics_server/metrics_server_spec.rb @@ -23,6 +23,8 @@ RSpec.describe 'bin/metrics-server', :aggregate_failures do end context 'with a running server' do + let(:metrics_dir) { Dir.mktmpdir } + before do # We need to send a request to localhost WebMock.allow_net_connect! @@ -33,7 +35,8 @@ RSpec.describe 'bin/metrics-server', :aggregate_failures do env = { 'GITLAB_CONFIG' => config_file.path, 'METRICS_SERVER_TARGET' => 'sidekiq', - 'WIPE_METRICS_DIR' => '1' + 'WIPE_METRICS_DIR' => '1', + 'prometheus_multiproc_dir' => metrics_dir } @pid = Process.spawn(env, 'bin/metrics-server', pgroup: true) end @@ -55,6 +58,7 @@ RSpec.describe 'bin/metrics-server', :aggregate_failures do # 'No such process' means the process died before ensure config_file.unlink + FileUtils.rm_rf(metrics_dir, secure: true) end it 'serves /metrics endpoint' do |