summaryrefslogtreecommitdiff
path: root/spec/support/chunked_io/chunked_io_helpers.rb
blob: 4238a4b3e94738d16f8c0f283867a09eb4fab568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module ChunkedIOHelpers
  def sample_trace_raw
    @sample_trace_raw ||= File.read(expand_fixture_path('trace/sample_trace'))
      .force_encoding(Encoding::BINARY)
  end

  def stub_buffer_size(size)
    stub_const('Ci::BuildTraceChunk::CHUNK_SIZE', size)
    stub_const('Gitlab::Ci::Trace::ChunkedIO::CHUNK_SIZE', size)
  end

  def redis_shared_state_outage!
    Gitlab::Redis::SharedState.with(&:flushall)
    Sidekiq.redis(&:flushall)
  end
end