diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-06-01 20:36:59 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-06-01 20:36:59 +0000 |
commit | b92e3d746466667642fd99d1ed72b481488d1a9f (patch) | |
tree | 4ea61086bbb5166fb7d3ff946ac18287913dd49a /spec/services/ci/create_pipeline_service_spec.rb | |
parent | 1cd5c6d940baf5ee03e14ab924c4bb198aa04fd7 (diff) | |
parent | 94be44c568b0167bbcc1e975ab674747a8271dbc (diff) | |
download | gitlab-ce-b92e3d746466667642fd99d1ed72b481488d1a9f.tar.gz |
Merge branch 'dm-fix-pipeline-creation-race-condition' into 'master'
Fix race condition between pipeline creation and MR diff_head_sha update
Closes #33219
See merge request !11859
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 8bf02f56282..06fbd7bad90 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -72,10 +72,11 @@ describe Ci::CreatePipelineService, services: true do end end - context 'when merge request head commit sha does not match pipeline sha' do + context 'when the pipeline is not the latest for the branch' do it 'does not update merge request head pipeline' do merge_request = create(:merge_request, source_branch: 'master', target_branch: "branch_1", source_project: project) - allow_any_instance_of(MergeRequestDiff).to receive(:head_commit).and_return(double(id: 1234)) + + allow_any_instance_of(Ci::Pipeline).to receive(:latest?).and_return(false) pipeline |