Commit 28a00066 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add a test case to improve ci queue metrics coverage

parent 6965339d
......@@ -837,6 +837,7 @@ module Ci
it 'counts job queuing time histogram with expected labels' do
allow(attempt_counter).to receive(:increment)
expect(job_queue_duration_seconds).to receive(:observe)
.with({ shared_runner: expected_shared_runner,
jobs_running_for_project: expected_jobs_running_for_project_third_job,
......@@ -888,6 +889,16 @@ module Ci
it_behaves_like 'metrics collector'
end
context 'when max running jobs bucket size is exceeded' do
before do
stub_const('Gitlab::Ci::Queue::Metrics::JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET', 1)
end
let(:expected_jobs_running_for_project_third_job) { '1+' }
it_behaves_like 'metrics collector'
end
context 'when pending job with queued_at=nil is used' do
before do
pending_job.update!(queued_at: nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment