Commit ff814b89 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'jivanvl-remove-ci-reduce-queries-when-ticking-runner-queue-ff' into 'master'

Reduce queries when ticking the runner queue by default [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!62146
parents 80845e80 f4170c07
......@@ -363,11 +363,7 @@ module Ci
end
def pick_build!(build)
if Feature.enabled?(:ci_reduce_queries_when_ticking_runner_queue, self, default_enabled: :yaml)
tick_runner_queue if matches_build?(build)
else
tick_runner_queue if can_pick?(build)
end
tick_runner_queue if matches_build?(build)
end
def uncached_contacted_at
......
---
name: ci_reduce_queries_when_ticking_runner_queue
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55496
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/323328
milestone: '13.10'
type: development
group: group::continuous integration
default_enabled: true
......@@ -919,29 +919,13 @@ RSpec.describe Ci::Runner do
end
end
context 'build picking improvement enabled' do
before do
stub_feature_flags(ci_reduce_queries_when_ticking_runner_queue: true)
end
context 'build picking improvement' do
it 'does not check if the build is assignable to a runner' do
expect(runner).not_to receive(:can_pick?)
runner.pick_build!(build)
end
end
context 'build picking improvement disabled' do
before do
stub_feature_flags(ci_reduce_queries_when_ticking_runner_queue: false)
end
it 'checks if the build is assignable to a runner' do
expect(runner).to receive(:can_pick?).and_call_original
runner.pick_build!(build)
end
end
end
describe 'project runner without projects is destroyable' do
......
......@@ -129,19 +129,6 @@ RSpec.describe Ci::UpdateBuildQueueService do
subject.tick(build)
end
context 'when feature flag ci_reduce_queries_when_ticking_runner_queue is disabled' do
before do
stub_feature_flags(ci_reduce_queries_when_ticking_runner_queue: false)
stub_feature_flags(ci_runners_short_circuit_assignable_for: false)
end
it 'runs redundant queries using `owned_or_instance_wide` scope' do
expect(Ci::Runner).to receive(:owned_or_instance_wide).and_call_original
subject.tick(build)
end
end
end
end
......@@ -218,10 +205,9 @@ RSpec.describe Ci::UpdateBuildQueueService do
let!(:build) { create(:ci_build, pipeline: pipeline, tag_list: %w[a b]) }
let!(:project_runner) { create(:ci_runner, :project, :online, projects: [project], tag_list: %w[a b c]) }
context 'when ci_preload_runner_tags and ci_reduce_queries_when_ticking_runner_queue are enabled' do
context 'when ci_preload_runner_tags is enabled' do
before do
stub_feature_flags(
ci_reduce_queries_when_ticking_runner_queue: true,
ci_preload_runner_tags: true
)
end
......@@ -235,10 +221,9 @@ RSpec.describe Ci::UpdateBuildQueueService do
end
end
context 'when ci_preload_runner_tags and ci_reduce_queries_when_ticking_runner_queue are disabled' do
context 'when ci_preload_runner_tags are disabled' do
before do
stub_feature_flags(
ci_reduce_queries_when_ticking_runner_queue: false,
ci_preload_runner_tags: false
)
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