Commit cae17352 authored by Shinya Maeda's avatar Shinya Maeda

Fix typos and add a small spec

parent f9b821f0
...@@ -130,7 +130,7 @@ describe Ci::Build do ...@@ -130,7 +130,7 @@ describe Ci::Build do
context 'when build does not have live trace' do context 'when build does not have live trace' do
let!(:build) { create(:ci_build, :success, :trace_artifact) } 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 is_expected.to be_empty
end end
end end
......
...@@ -246,12 +246,14 @@ shared_examples_for 'common trace features' do ...@@ -246,12 +246,14 @@ shared_examples_for 'common trace features' do
expect(build.job_artifacts_trace).to be_exist expect(build.job_artifacts_trace).to be_exist
end 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 before do
Gitlab::ExclusiveLease.new("trace:archive:#{trace.job.id}", timeout: 1.hour).try_obtain Gitlab::ExclusiveLease.new("trace:archive:#{trace.job.id}", timeout: 1.hour).try_obtain
end 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 subject
build.reload build.reload
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment