Skip to content

Commit 3149f46

Browse files
Assert all mod_call(s)
+
1 parent e7d42ec commit 3149f46

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

deps/rabbit/test/rabbit_fifo_SUITE.erl

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,13 +1750,28 @@ single_active_consumer_priority_test(Config) ->
17501750
when map_size(Ch) == 0)
17511751

17521752
],
1753-
{#rabbit_fifo{ cfg = #cfg{resource = Resource}}, ModCalls} = run_log(Config, S0, Entries, fun single_active_invariant/1),
1753+
{#rabbit_fifo{ cfg = #cfg{resource = Resource}}, StateMachineEvents} = run_log(Config, S0, Entries, fun single_active_invariant/1),
1754+
ModCalls = [ S || S = {mod_call, rabbit_quorum_queue, update_consumer_handler, _} <- StateMachineEvents ],
1755+
ct:log("ModCalls: ~p", [ModCalls]),
1756+
1757+
%% At the beginning, C1 should be added as single_active
1758+
assert_update_consumer_handler_called(C1, Resource, single_active, lists:nth(1, ModCalls)),
1759+
%% C1 should transition to waiting
1760+
assert_update_consumer_handler_called(C1, Resource, waiting, lists:nth(2, ModCalls)),
1761+
%% And C2 should become single_active
1762+
assert_update_consumer_handler_called(C2, Resource, single_active, lists:nth(3, ModCalls)),
1763+
%% Finally C2 should transition as waiting
1764+
assert_update_consumer_handler_called(C2, Resource, waiting, lists:nth(4, ModCalls)),
1765+
%% Because C3 is added as single_active
1766+
assert_update_consumer_handler_called(C3, Resource, single_active, lists:nth(5, ModCalls)),
1767+
1768+
ok.
1769+
1770+
assert_update_consumer_handler_called(ConsumerId, Resource, UpdatedState, ModCall) ->
17541771
{mod_call,rabbit_quorum_queue,update_consumer_handler,
1755-
[Resource,
1756-
_,
1757-
false,undefined,undefined,false,waiting,[]]} = lists:nth(3, ModCalls),
1758-
ok.
1759-
1772+
[Resource,
1773+
ConsumerId,
1774+
_,_,_,_,UpdatedState,[]]} = ModCall.
17601775

17611776
single_active_consumer_priority_cancel_active_test(Config) ->
17621777
S0 = init(#{name => ?FUNCTION_NAME,

0 commit comments

Comments
 (0)