Fix typos and add a small spec
This commit is contained in:
parent
f9b821f08d
commit
cae1735276
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue