summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-11-27 11:56:06 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-11-27 11:56:15 +0100
commit6c1a4294209157b43db82678d34e3cba7d2cba3a (patch)
tree3a112c7760868430c64284bea861b3842914526b
parent07c7ba1bf4a1d0092d07a23e23caf698512d46e0 (diff)
downloadgitlab-ce-optimise-stuck-ci-jobs-worker.tar.gz
Fix stuck jobs testsoptimise-stuck-ci-jobs-worker
-rw-r--r--spec/workers/stuck_ci_jobs_worker_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/workers/stuck_ci_jobs_worker_spec.rb b/spec/workers/stuck_ci_jobs_worker_spec.rb
index 7f9545177bc..bdc64c6785b 100644
--- a/spec/workers/stuck_ci_jobs_worker_spec.rb
+++ b/spec/workers/stuck_ci_jobs_worker_spec.rb
@@ -106,7 +106,7 @@ describe StuckCiJobsWorker do
end
it 'does drop job' do
- expect_any_instance_of(Ci::Build).to receive(:drop)
+ expect_any_instance_of(Ci::Build).to receive(:drop).and_call_original
worker.perform
end
end
@@ -117,7 +117,7 @@ describe StuckCiJobsWorker do
let(:worker2) { described_class.new }
it 'is guard by exclusive lease when executed concurrently' do
- expect(worker).to receive(:drop).at_least(:once)
+ expect(worker).to receive(:drop).at_least(:once).and_call_original
expect(worker2).not_to receive(:drop)
worker.perform
allow_any_instance_of(Gitlab::ExclusiveLease).to receive(:try_obtain).and_return(false)
@@ -125,8 +125,8 @@ describe StuckCiJobsWorker do
end
it 'can be executed in sequence' do
- expect(worker).to receive(:drop).at_least(:once)
- expect(worker2).to receive(:drop).at_least(:once)
+ expect(worker).to receive(:drop).at_least(:once).and_call_original
+ expect(worker2).to receive(:drop).at_least(:once).and_call_original
worker.perform
worker2.perform
end