Skip to content

Commit

Permalink
missing spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mensfeld committed Feb 20, 2024
1 parent 643c2d6 commit bf4da22
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions spec/lib/waterdrop/producer/async_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,32 @@
it { expect(occurred.first.payload[:label]).to eq(nil) }
end

context 'when inline error occurs and we retry on queue full but instrumentation off' do
let(:errors) { [] }
let(:occurred) { [] }
let(:error) { errors.first }
let(:producer) { build(:slow_producer, wait_on_queue_full: true) }

before do
producer.config.wait_on_queue_full = true
producer.config.instrument_on_wait_queue_full = false

producer.monitor.subscribe('error.occurred') do |event|
occurred << event
end

begin
message = build(:valid_message, label: 'test')
5.times { producer.produce_async(message) }
rescue WaterDrop::Errors::ProduceError => e
errors << e
end
end

it { expect(errors).to be_empty }
it { expect(occurred).to be_empty }
end

context 'when inline error occurs in librdkafka and we go beyond max wait on queue full' do
let(:errors) { [] }
let(:occurred) { [] }
Expand Down

0 comments on commit bf4da22

Please sign in to comment.