Commit d28832fe authored by Kerri Miller's avatar Kerri Miller

Merge branch 'jivanvl-remove-gitlab-ci-builds-queue-limit' into 'master'

Enable builds queue limit by default [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62405
parents e9c896b3 c853efd7
...@@ -182,13 +182,7 @@ module Ci ...@@ -182,13 +182,7 @@ module Ci
end end
def max_queue_depth def max_queue_depth
@max_queue_depth ||= begin MAX_QUEUE_DEPTH
if Feature.enabled?(:gitlab_ci_builds_queue_limit, runner, default_enabled: true)
MAX_QUEUE_DEPTH
else
::Gitlab::Database::MAX_INT_VALUE
end
end
end end
# Force variables evaluation to occur now # Force variables evaluation to occur now
......
---
name: gitlab_ci_builds_queue_limit
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54579
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323201
milestone: '13.10'
type: development
group: group::continuous integration
default_enabled: true
...@@ -839,34 +839,13 @@ module Ci ...@@ -839,34 +839,13 @@ module Ci
stub_const("#{described_class}::MAX_QUEUE_DEPTH", 2) stub_const("#{described_class}::MAX_QUEUE_DEPTH", 2)
end end
context 'when feature is enabled' do it 'returns 409 conflict' do
before do expect(Ci::Build.pending.unstarted.count).to eq 3
stub_feature_flags(gitlab_ci_builds_queue_limit: true)
end
it 'returns 409 conflict' do
expect(Ci::Build.pending.unstarted.count).to eq 3
result = described_class.new(specific_runner).execute
expect(result).not_to be_valid
expect(result.build).to be_nil
end
end
context 'when feature is disabled' do
before do
stub_feature_flags(gitlab_ci_builds_queue_limit: false)
end
it 'returns a valid result' do
expect(Ci::Build.pending.unstarted.count).to eq 3
result = described_class.new(specific_runner).execute result = described_class.new(specific_runner).execute
expect(result).to be_valid expect(result).not_to be_valid
expect(result.build).to eq pending_job_3 expect(result.build).to be_nil
end
end end
end end
......
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