Commit c077f27e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'fix/gb/ci-build-stuck-badge-performance-experiment' into 'master'

Add build stuck badge performance experiment

See merge request gitlab-org/gitlab!50521
parents 76b5b71b 54640315
...@@ -730,7 +730,13 @@ module Ci ...@@ -730,7 +730,13 @@ module Ci
end end
def any_runners_online? def any_runners_online?
project.any_runners? { |runner| runner.active? && runner.online? && runner.can_pick?(self) } project.any_runners? do |runner|
if Feature.enabled?(:ci_build_stuck_badge_performance_experiment, project, type: :development, default_enabled: false)
runner.active? && runner.online?
else
runner.active? && runner.online? && runner.can_pick?(self)
end
end
end end
def stuck? def stuck?
......
---
title: Add build stuck badge performance experiment
merge_request: 50521
author:
type: performance
---
name: ci_build_stuck_badge_performance_experiment
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50521
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/295490
milestone: '13.7'
type: development
group: group::continuous integration
default_enabled: false
...@@ -580,9 +580,27 @@ RSpec.describe Ci::Build do ...@@ -580,9 +580,27 @@ RSpec.describe Ci::Build do
is_expected.to be_falsey is_expected.to be_falsey
end end
it 'that cannot handle build' do context 'when runners are on-line but none can pick a build' do
expect_any_instance_of(Ci::Runner).to receive(:can_pick?).and_return(false) before do
is_expected.to be_falsey allow_any_instance_of(Ci::Runner)
.to receive(:can_pick?).and_return(false)
end
context 'when a performance experiement feature flag is enabled' do
before do
stub_feature_flags(ci_build_stuck_badge_performance_experiment: true)
end
it { is_expected.to be_truthy }
end
context 'when a performance experiment is not running' do
before do
stub_feature_flags(ci_build_stuck_badge_performance_experiment: false)
end
it { is_expected.to be_falsey }
end
end 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