summaryrefslogtreecommitdiff
path: root/spec/models/ci/build_trace_chunk_spec.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-05-04 21:19:57 +0900
committerShinya Maeda <shinya@gitlab.com>2018-05-04 21:19:57 +0900
commit5627f28cb886342b2555b38747458a6bee196ebe (patch)
treea9bd60ddfadbad480c80a0407e9edc24c5723408 /spec/models/ci/build_trace_chunk_spec.rb
parentecf8287ce5f81aafefaa7b505f620c22527515d9 (diff)
downloadgitlab-ce-5627f28cb886342b2555b38747458a6bee196ebe.tar.gz
Added shared exmaple for fast_destroy_all concern
Diffstat (limited to 'spec/models/ci/build_trace_chunk_spec.rb')
-rw-r--r--spec/models/ci/build_trace_chunk_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb
index 46d09dff52c..cbcf1e55979 100644
--- a/spec/models/ci/build_trace_chunk_spec.rb
+++ b/spec/models/ci/build_trace_chunk_spec.rb
@@ -14,6 +14,21 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do
stub_feature_flags(ci_enable_live_trace: true)
end
+ context 'FastDestroyAll' do
+ let(:parent) { create(:project) }
+ let(:pipeline) { create(:ci_pipeline, project: parent) }
+ let(:build) { create(:ci_build, :running, :trace_live, pipeline: pipeline, project: parent) }
+ let(:subjects) { build.trace_chunks }
+
+ it_behaves_like 'fast destroyable'
+
+ def external_data_counter
+ Gitlab::Redis::SharedState.with do |redis|
+ redis.scan_each(match: "gitlab:ci:trace:*:chunks:*").to_a.size
+ end
+ end
+ end
+
describe 'CHUNK_SIZE' do
it 'Chunk size can not be changed without special care' do
expect(described_class::CHUNK_SIZE).to eq(128.kilobytes)