diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 15:06:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 15:06:32 +0300 |
commit | d2ffc30fd583e86d4122bb5061098f4f3ca7b3f1 (patch) | |
tree | cb29c77a3ea49eb8ec732b0e644ed6cfad4770d9 /spec/lib/gitlab/metrics | |
parent | 914ea32e0efca21436220df2c10e1bfbe4ed3da9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/metrics')
-rw-r--r-- | spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb b/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb index bedf4fedcfa..0376da13595 100644 --- a/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb +++ b/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb @@ -64,6 +64,18 @@ describe Gitlab::Metrics::Exporter::BaseExporter do exporter.start.join end end + + describe 'when thread is not alive' do + it 'does close listeners' do + expect_any_instance_of(::WEBrick::HTTPServer).to receive(:start) + expect_any_instance_of(::WEBrick::HTTPServer).to receive(:listeners) + .and_call_original + + expect { exporter.start.join }.to change { exporter.thread? }.from(false).to(true) + + exporter.stop + end + end end describe '#stop' do |