Skip to content

Commit 0238be5

Browse files
markusgustmergify[bot]
authored andcommitted
fixup: addressing feedback and cleaning up tests
(cherry picked from commit 878d53e)
1 parent 243800f commit 0238be5

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

deps/rabbitmq_shovel/src/rabbit_local_shovel.erl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ add_routing(Msg0, Dest) ->
444444
status(_) ->
445445
running.
446446

447-
pending_count(#{source := #{current := #{unacked_message_q := UAMQ}}}) ->
448-
?QUEUE:len(UAMQ);
449447
pending_count(_State) ->
450448
0.
451449

deps/rabbitmq_shovel/test/pending_count_SUITE.erl

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ groups() ->
3232
amqp10_pending_count_with_messages,
3333
amqp10_pending_count_after_clear,
3434
local_pending_count_empty_queue,
35-
local_pending_count_with_messages,
3635
local_pending_count_after_settle,
3736
behaviour_metrics_includes_pending,
3837
behaviour_pending_count_delegation
@@ -104,11 +103,6 @@ local_pending_count_empty_queue(_Config) ->
104103
State = #{source => #{current => #{unacked_message_q => EmptyQueue}}},
105104
?assertEqual(0, rabbit_local_shovel:pending_count(State)).
106105

107-
local_pending_count_with_messages(_Config) ->
108-
%% Test that pending_count returns correct count from unacked message queue
109-
UnackedQueue = lqueue:from_list([msg1, msg2, msg3, msg4]),
110-
State = #{source => #{current => #{unacked_message_q => UnackedQueue}}},
111-
?assertEqual(4, rabbit_local_shovel:pending_count(State)).
112106

113107
local_pending_count_after_settle(_Config) ->
114108
%% Test that pending_count returns 0 when state doesn't contain unacked queue
@@ -148,28 +142,3 @@ behaviour_pending_count_delegation(_Config) ->
148142

149143
?assertEqual(3, maps:get(pending, Metrics)),
150144
?assert(meck:validate(rabbit_amqp10_shovel)).
151-
152-
%%%===================================================================
153-
%%% Integration tests for pending_count behavior in different scenarios
154-
%%%===================================================================
155-
156-
%% Additional test cases to verify pending_count behavior in realistic scenarios
157-
%% These could be added if we want to test the actual message flow scenarios
158-
159-
pending_count_during_flow_control(_Config) ->
160-
%% Test case outline: Verify pending_count increases when flow control blocks forwarding
161-
%% and decreases when flow control is lifted
162-
%% This would require more complex setup with actual message handling
163-
ok.
164-
165-
pending_count_with_multiple_ack_modes(_Config) ->
166-
%% Test case outline: Verify pending_count behaves correctly across different ack modes
167-
%% (no_ack, on_publish, on_confirm)
168-
ok.
169-
170-
pending_count_edge_cases(_Config) ->
171-
%% Test case outline: Test edge cases like:
172-
%% - Missing dest/source maps
173-
%% - Malformed pending data structures
174-
%% - Very large pending counts
175-
ok.

0 commit comments

Comments
 (0)