Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-06-01 10:15:41 +0300
committerShinya Maeda <shinya@gitlab.com>2018-06-06 11:49:48 +0300
commit2522691eda46ef3ed572b747074e9b3b2e776198 (patch)
tree76ea84bce4286cc1d20782b234cc42cc79a81c24 /spec/workers
parent174c892e7efcd65b1c4560bddec6bb9b6d7fa966 (diff)
Fix ambiguous stuck ci job worker's spec. Rename lease key of archive
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/ci/rescue_stale_live_trace_worker_spec.rb2
-rw-r--r--spec/workers/stuck_ci_jobs_worker_spec.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb b/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb
index 43a6362a131..1a694290562 100644
--- a/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb
+++ b/spec/workers/ci/rescue_stale_live_trace_worker_spec.rb
@@ -35,7 +35,7 @@ describe Ci::RescueStaleLiveTraceWorker do
context 'when build has both archived trace and live trace' do
let!(:build2) { create(:ci_build, :success, :trace_live, finished_at: 2.days.ago) }
-
+
it 'archives only available targets' do
subject
diff --git a/spec/workers/stuck_ci_jobs_worker_spec.rb b/spec/workers/stuck_ci_jobs_worker_spec.rb
index bdc64c6785b..c3294fce5ea 100644
--- a/spec/workers/stuck_ci_jobs_worker_spec.rb
+++ b/spec/workers/stuck_ci_jobs_worker_spec.rb
@@ -132,8 +132,10 @@ describe StuckCiJobsWorker do
end
it 'cancels exclusive lease after worker perform' do
- expect(Gitlab::ExclusiveLease).to receive(:cancel).with(described_class::EXCLUSIVE_LEASE_KEY, exclusive_lease_uuid)
worker.perform
+
+ expect(Gitlab::ExclusiveLease.new(described_class::EXCLUSIVE_LEASE_KEY, timeout: 1.hour).exists?)
+ .to be_falsy
end
end
end