Skip to content

Commit e7e1fb7

Browse files
michaelklishinmergify[bot]
authored andcommitted
Update a #13175 test to not use private Ra machine state
(cherry picked from commit e49acf9) (cherry picked from commit d54fee2)
1 parent 9bc9276 commit e7e1fb7

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

deps/rabbit/test/quorum_queue_SUITE.erl

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,26 +1347,31 @@ force_checkpoint_on_queue(Config) ->
13471347
?assertEqual({'queue.declare_ok', QQ, 0, 0},
13481348
declare(Ch, QQ, [{<<"x-queue-type">>, longstr, <<"quorum">>}])),
13491349

1350-
rabbit_ct_client_helpers:publish(Ch, QQ, 3),
1351-
wait_for_messages_ready([Server0], RaName, 3),
1350+
N = 17000,
1351+
rabbit_ct_client_helpers:publish(Ch, QQ, N),
1352+
wait_for_messages_ready([Server0], RaName, N),
13521353

1353-
% Wait for initial checkpoint and make sure it's 0; checkpoint hasn't been triggered yet.
1354+
%% The state before any checkpoints
13541355
rabbit_ct_helpers:await_condition(
13551356
fun() ->
1356-
{ok, #{aux := Aux}, _} = rpc:call(Server0, ra, member_overview, [{RaName, Server0}]),
1357-
#aux_v3{last_checkpoint = #checkpoint{index = Index}} = Aux,
1358-
Index =:= 0
1357+
{ok, State, _} = rpc:call(Server0, ra, member_overview, [{RaName, Server0}]),
1358+
#{log := #{latest_checkpoint_index := LCI}} = State,
1359+
LCI =:= undefined
13591360
end),
13601361

1362+
%% {ok, State0, _} = rpc:call(Server0, ra, member_overview, [{RaName, Server0}]),
1363+
%% ct:pal("Ra server state before forcing a checkpoint: ~tp~n", [State0]),
1364+
13611365
rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_quorum_queue,
13621366
force_checkpoint_on_queue, [QName]),
13631367

1364-
% Wait for initial checkpoint and make sure it's not 0
1368+
%% Wait for initial checkpoint and make sure it's not 0
13651369
rabbit_ct_helpers:await_condition(
13661370
fun() ->
1367-
{ok, #{aux := Aux}, _} = rpc:call(Server0, ra, member_overview, [{RaName, Server0}]),
1368-
#aux_v3{last_checkpoint = #checkpoint{index = Index}} = Aux,
1369-
Index =/= 0
1371+
{ok, State, _} = rpc:call(Server0, ra, member_overview, [{RaName, Server0}]),
1372+
%% ct:pal("Ra server state: ~tp~n", [State]),
1373+
#{log := #{latest_checkpoint_index := LCI}} = State,
1374+
LCI >= N
13701375
end).
13711376

13721377
force_checkpoint(Config) ->

0 commit comments

Comments
 (0)