diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/services/ci/register_job_service_spec.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/services/ci/register_job_service_spec.rb')
-rw-r--r-- | spec/services/ci/register_job_service_spec.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb index e2e760b9812..f40f5cc5a62 100644 --- a/spec/services/ci/register_job_service_spec.rb +++ b/spec/services/ci/register_job_service_spec.rb @@ -14,25 +14,29 @@ module Ci let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) } describe '#execute' do - context 'checks database loadbalancing stickiness' do - subject { described_class.new(shared_runner).execute } + subject { described_class.new(shared_runner).execute } + context 'checks database loadbalancing stickiness' do before do project.update!(shared_runners_enabled: false) end - it 'result is valid if replica did caught-up' do + it 'result is valid if replica did caught-up', :aggregate_failures do expect(ApplicationRecord.sticking).to receive(:all_caught_up?) .with(:runner, shared_runner.id) { true } expect(subject).to be_valid + expect(subject.build).to be_nil + expect(subject.build_json).to be_nil end - it 'result is invalid if replica did not caught-up' do + it 'result is invalid if replica did not caught-up', :aggregate_failures do expect(ApplicationRecord.sticking).to receive(:all_caught_up?) .with(:runner, shared_runner.id) { false } expect(subject).not_to be_valid + expect(subject.build).to be_nil + expect(subject.build_json).to be_nil end end @@ -954,6 +958,7 @@ module Ci expect(result).not_to be_valid expect(result.build).to be_nil + expect(result.build_json).to be_nil end end |