diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-07-18 16:22:46 +0700 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-07-23 17:26:08 +0700 |
commit | c2e0e689f355555db231ac6db40ab1b654c90233 (patch) | |
tree | 1ab8b2e6561598a61a10a0197a975019ed13f464 /spec/lib/gitlab/ci/trace/chunked_io_spec.rb | |
parent | 1a3fda63a5f9756cde19bc7e221651b0c33cb5dc (diff) | |
download | gitlab-ce-safe-archiving-for-traces.tar.gz |
Validate the existence of archived traces before removing live tracesafe-archiving-for-traces
Often live traces are removed even though the archived trace
doesn't exist. This commit checkes the existence strictly.
Diffstat (limited to 'spec/lib/gitlab/ci/trace/chunked_io_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/trace/chunked_io_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/trace/chunked_io_spec.rb b/spec/lib/gitlab/ci/trace/chunked_io_spec.rb index 546a9e7d0cc..3e5cd81f929 100644 --- a/spec/lib/gitlab/ci/trace/chunked_io_spec.rb +++ b/spec/lib/gitlab/ci/trace/chunked_io_spec.rb @@ -442,5 +442,15 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do expect(Ci::BuildTraceChunk.where(build: build).count).to eq(0) end + + context 'when the job does not have archived trace' do + it 'leaves a message in sidekiq log' do + expect(Sidekiq.logger).to receive(:warn).with( + message: 'The job does not have archived trace but going to be destroyed.', + job_id: build.id).and_call_original + + subject + end + end end end |