Skip to content

Commit

Permalink
stabilize spec for slow ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mensfeld committed Sep 16, 2024
1 parent be7da3a commit 34eaf6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions spec/lib/waterdrop/producer/transactions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,17 +535,15 @@
end

context 'when we abort the nested transaction' do
subject(:producer) { build(:transactional_producer, queue_buffering_max_ms: 5_000) }

it 'expect to abort all levels' do
handlers = []

producer.transaction do
handlers << producer.produce_async(topic: 'example_topic', payload: 'data')

sleep(0.1)

producer.transaction do
sleep(0.1)

handlers << producer.produce_async(topic: 'example_topic', payload: 'data')
raise(WaterDrop::AbortTransaction)
end
Expand Down
4 changes: 3 additions & 1 deletion spec/support/factories/producer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
transaction_timeout_ms { 30_000 }
request_required_acks { 'all' }
idempotent { true }
queue_buffering_max_ms { 5 }
end

kafka do
Expand All @@ -52,7 +53,8 @@
'transactional.id': transactional_id,
'transaction.timeout.ms': transaction_timeout_ms,
'message.timeout.ms': transaction_timeout_ms,
'enable.idempotence': idempotent
'enable.idempotence': idempotent,
'queue.buffering.max.ms': queue_buffering_max_ms
}
end
end
Expand Down

0 comments on commit 34eaf6b

Please sign in to comment.