summaryrefslogtreecommitdiff
path: root/spec/models/ci/pipeline_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-22 13:41:39 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-22 13:41:39 +0800
commitd20c0682ac4a91f9cdea1d71f9eb515755955c7a (patch)
tree98f159e96abd6d3e7f17330c44ece89acda681c5 /spec/models/ci/pipeline_spec.rb
parentda9726170c377f2895992cd5c7b5e48eb351c045 (diff)
downloadgitlab-ce-d20c0682ac4a91f9cdea1d71f9eb515755955c7a.tar.gz
Just create failed builds rather than calling events
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7617#note_18763033
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r--spec/models/ci/pipeline_spec.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index ea5e0e28c5c..ea022e03608 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -571,13 +571,10 @@ describe Ci::Pipeline, models: true do
context 'with failed pipeline' do
before do
perform_enqueued_jobs do
- create(:ci_build, :created, pipeline: pipeline)
- create(:generic_commit_status, :created, pipeline: pipeline)
+ create(:ci_build, :failed, pipeline: pipeline)
+ create(:generic_commit_status, :failed, pipeline: pipeline)
- pipeline.statuses.count.times do |offset|
- # workaround race conditions
- pipeline.statuses.offset(offset).first.drop
- end
+ pipeline.drop
end
end