From cae17352761d9c34de444cb95e77d8fa1a8bd56a Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Mon, 4 Jun 2018 14:12:45 +0900 Subject: [PATCH] Fix typos and add a small spec --- spec/models/ci/build_spec.rb | 2 +- spec/support/shared_examples/ci_trace_shared_examples.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 1b26c8d3b49..0a0d7d3fea9 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -130,7 +130,7 @@ describe Ci::Build do context 'when build does not have live trace' do let!(:build) { create(:ci_build, :success, :trace_artifact) } - it 'selects the build' do + it 'does not select the build' do is_expected.to be_empty end end diff --git a/spec/support/shared_examples/ci_trace_shared_examples.rb b/spec/support/shared_examples/ci_trace_shared_examples.rb index 59efce1b5f0..6dbe0f6f980 100644 --- a/spec/support/shared_examples/ci_trace_shared_examples.rb +++ b/spec/support/shared_examples/ci_trace_shared_examples.rb @@ -246,12 +246,14 @@ shared_examples_for 'common trace features' do expect(build.job_artifacts_trace).to be_exist end - context 'when anothe process had already been archiving', :clean_gitlab_redis_shared_state do + context 'when another process has already been archiving', :clean_gitlab_redis_shared_state do before do Gitlab::ExclusiveLease.new("trace:archive:#{trace.job.id}", timeout: 1.hour).try_obtain end - it 'prevents to archive concurently' do + it 'blocks concurrent archiving' do + expect(Rails.logger).to receive(:error).with('Cannot obtain an exclusive lease. There must be another instance already in execution.') + subject build.reload