diff options
| author | Michael Klishin <michael@novemberain.com> | 2019-02-01 21:16:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-01 21:16:06 +0300 |
| commit | c52e07718b799bf8a1bebae2f551e175377cf83d (patch) | |
| tree | e790f0887556e7afdd4ba7777bb7441879523cc8 /test | |
| parent | 7e8bb7fae33ae7f3979deb08691b58fb5717fb69 (diff) | |
| parent | 3df6e2faa04603f001b86f0cc4507c3b1badc027 (diff) | |
| download | rabbitmq-server-git-c52e07718b799bf8a1bebae2f551e175377cf83d.tar.gz | |
Merge pull request #1857 from rabbitmq/rabbit-fifo-snapshotting-fix
Rabbit fifo snapshotting improvements
Diffstat (limited to 'test')
| -rw-r--r-- | test/rabbit_fifo_prop_SUITE.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl index 5643da1991..c4f5690b72 100644 --- a/test/rabbit_fifo_prop_SUITE.erl +++ b/test/rabbit_fifo_prop_SUITE.erl @@ -261,11 +261,11 @@ map_max(0) -> undefined; map_max(N) -> N. snapshots_prop(Conf, Commands) -> - ct:pal("Commands: ~p~nConf~p~n", [Commands, Conf]), try run_snapshot_test(Conf, Commands) of _ -> true catch Err -> + ct:pal("Commands: ~p~nConf~p~n", [Commands, Conf]), ct:pal("Err: ~p~n", [Err]), false end. @@ -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,16 +473,16 @@ 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), - % ct:pal("beginning snapshot test run for ~w numn commands ~b", - % [maps:get(name, Conf), length(Commands)]), + {State0, Effects} = run_log(test_init(Conf), Entries), + State = rabbit_fifo:normalize(State0), [begin %% drop all entries below and including the snapshot Filtered = lists:dropwhile(fun({X, _}) when X =< SnapIdx -> true; (_) -> false end, Entries), - {S, _} = run_log(SnapState, Filtered), + {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 +516,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)). |
