summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkjnilsson <knilsson@pivotal.io>2019-01-31 17:45:36 +0000
committerkjnilsson <knilsson@pivotal.io>2019-02-01 11:15:10 +0000
commitfccacda101cb9a4f4968152228ba47a616d8587b (patch)
tree24143a58f531ac880d23626eb35eac2c87efeb05 /test
parent6ff8e97a086fe9bc6f05d7d5013de68a7d3dec94 (diff)
downloadrabbitmq-server-git-fccacda101cb9a4f4968152228ba47a616d8587b.tar.gz
Ensure rabbit_fifo snaphots are emitted
More regularly. Previously if more than one message was settled at a time, stored potential snapshots could have been missed. [#163631659]
Diffstat (limited to 'test')
-rw-r--r--test/rabbit_fifo_prop_SUITE.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl
index 5643da1991..c9a9183b5f 100644
--- a/test/rabbit_fifo_prop_SUITE.erl
+++ b/test/rabbit_fifo_prop_SUITE.erl
@@ -310,7 +310,7 @@ checkout_gen(Pid) ->
-record(t, {state = rabbit_fifo:init(#{name => proper,
queue_resource => blah,
- shadow_copy_interval => 1})
+ release_cursor_interval => 1})
:: rabbit_fifo:state(),
index = 1 :: non_neg_integer(), %% raft index
enqueuers = #{} :: #{pid() => term()},
@@ -473,7 +473,8 @@ run_snapshot_test(Conf, Commands) ->
run_snapshot_test0(Conf, Commands) ->
Indexes = lists:seq(1, length(Commands)),
Entries = lists:zip(Indexes, Commands),
- {State, Effects} = run_log(test_init(Conf), Entries),
+ {State0, Effects} = run_log(test_init(Conf), Entries),
+ State = rabbit_fifo:normalize(State0),
% ct:pal("beginning snapshot test run for ~w numn commands ~b",
% [maps:get(name, Conf), length(Commands)]),
@@ -482,7 +483,12 @@ run_snapshot_test0(Conf, Commands) ->
Filtered = lists:dropwhile(fun({X, _}) when X =< SnapIdx -> true;
(_) -> false
end, Entries),
- {S, _} = run_log(SnapState, Filtered),
+ % ct:pal("running from snapshot at ~w ~p", [SnapIdx, SnapState]),
+ % ct:pal("Snapshot tests run log:~n"
+ % "~p~n from ~n~p~n Entries~n~p~n",
+ % [Filtered, SnapState, Entries]),
+ {S0, _} = run_log(SnapState, Filtered),
+ S = rabbit_fifo:normalize(S0),
% assert log can be restored from any release cursor index
case S of
State -> ok;
@@ -516,7 +522,7 @@ run_log(InitState, Entries) ->
test_init(Conf) ->
Default = #{queue_resource => blah,
- shadow_copy_interval => 0,
+ release_cursor_interval => 0,
metrics_handler => {?MODULE, metrics_handler, []}},
rabbit_fifo:init(maps:merge(Default, Conf)).