Skip to content

Commit 666bf29

Browse files
Verify previous active consumer is waiting
after a higher priority consumer
1 parent 08a74da commit 666bf29

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

deps/rabbit/test/rabbit_fifo_SUITE.erl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,8 +1728,8 @@ single_active_consumer_priority_test(Config) ->
17281728
%% add a consumer with a higher priority, assert it becomes active
17291729
{CK2, make_checkout(C2, {auto, {simple_prefetch, 1}}, #{priority => 2})},
17301730
?ASSERT(#rabbit_fifo{consumers = #{CK2 := #consumer{status = up}},
1731-
waiting_consumers = [_]}),
1732-
1731+
waiting_consumers = [{CK1, _}]}),
1732+
17331733
%% enqueue a message
17341734
{E1Idx , rabbit_fifo:make_enqueue(Pid1, 1, msg1)},
17351735
?ASSERT(#rabbit_fifo{consumers = #{CK2 := #consumer{next_msg_id = 1,
@@ -1751,8 +1751,11 @@ single_active_consumer_priority_test(Config) ->
17511751
when map_size(Ch) == 0)
17521752

17531753
],
1754-
{_S1, _} = run_log(Config, S0, Entries, fun single_active_invariant/1),
1755-
1754+
{#rabbit_fifo{ cfg = #cfg{resource = Resource}}, ModCalls} = run_log(Config, S0, Entries, fun single_active_invariant/1),
1755+
{mod_call,rabbit_quorum_queue,update_consumer_handler,
1756+
[Resource,
1757+
_,
1758+
false,undefined,undefined,false,waiting,[]]} = lists:nth(3, ModCalls),
17561759
ok.
17571760

17581761

@@ -2352,6 +2355,7 @@ run_log(Config, InitState, Entries, Invariant) ->
23522355
run_log(Module, Config, InitState, Entries, Invariant) ->
23532356
lists:foldl(
23542357
fun ({assert, Fun}, {Acc0, Efx0}) ->
2358+
ct:log("run_log. Efx0 : ~p", [Efx0]),
23552359
_ = Fun(Acc0),
23562360
{Acc0, Efx0};
23572361
({Idx, E}, {Acc0, Efx0}) ->

0 commit comments

Comments
 (0)