bug_bunny 5.1.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe BugBunny::DrainTracker do
6
+ # Reloj controlado por el test: el tiempo avanza sólo cuando el spec lo mueve.
7
+ let(:current_time) { [100.0] }
8
+ let(:tracker) { described_class.new(clock: -> { current_time.first }) }
9
+
10
+ def advance(seconds)
11
+ current_time[0] += seconds
12
+ end
13
+
14
+ it 'no está ocioso mientras una entrega sigue en proceso, aunque venza la ventana' do
15
+ tracker.track do
16
+ advance(10)
17
+ expect(tracker.idle?(5)).to be(false)
18
+ end
19
+ end
20
+
21
+ it 'queda ocioso recién cuando pasa la ventana completa desde la última entrega' do
22
+ tracker.track { advance(1) }
23
+
24
+ advance(4.9)
25
+ expect(tracker.idle?(5)).to be(false)
26
+
27
+ advance(0.1)
28
+ expect(tracker.idle?(5)).to be(true)
29
+ end
30
+
31
+ it 'cuenta la entrega como procesada y la libera aunque el procesamiento levante' do
32
+ expect { tracker.track { raise 'boom' } }.to raise_error('boom')
33
+
34
+ expect(tracker.processed).to eq(1)
35
+ expect(tracker.busy?).to be(false)
36
+ end
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bug_bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-31 00:00:00.000000000 Z
11
+ date: 2026-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -248,6 +248,7 @@ files:
248
248
  - lib/bug_bunny/consumer.rb
249
249
  - lib/bug_bunny/consumer_middleware.rb
250
250
  - lib/bug_bunny/controller.rb
251
+ - lib/bug_bunny/drain_tracker.rb
251
252
  - lib/bug_bunny/exception.rb
252
253
  - lib/bug_bunny/middleware/base.rb
253
254
  - lib/bug_bunny/middleware/json_response.rb
@@ -281,6 +282,7 @@ files:
281
282
  - spec/integration/client_spec.rb
282
283
  - spec/integration/consumer_middleware_spec.rb
283
284
  - spec/integration/controller_spec.rb
285
+ - spec/integration/drain_spec.rb
284
286
  - spec/integration/error_handling_spec.rb
285
287
  - spec/integration/infrastructure_spec.rb
286
288
  - spec/integration/publisher_confirms_spec.rb
@@ -294,6 +296,7 @@ files:
294
296
  - spec/unit/consumer_middleware_spec.rb
295
297
  - spec/unit/consumer_spec.rb
296
298
  - spec/unit/controller_after_action_spec.rb
299
+ - spec/unit/drain_tracker_spec.rb
297
300
  - spec/unit/extra_top_level_params_spec.rb
298
301
  - spec/unit/observability_spec.rb
299
302
  - spec/unit/otel_spec.rb
@@ -314,7 +317,7 @@ metadata:
314
317
  homepage_uri: https://github.com/gedera/bug_bunny
315
318
  source_code_uri: https://github.com/gedera/bug_bunny
316
319
  changelog_uri: https://github.com/gedera/bug_bunny/blob/main/CHANGELOG.md
317
- documentation_uri: https://github.com/gedera/bug_bunny/blob/v5.1.1/skill
320
+ documentation_uri: https://github.com/gedera/bug_bunny/blob/v5.2.0/skill
318
321
  post_install_message:
319
322
  rdoc_options: []
320
323
  require_paths: