summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkjnilsson <knilsson@pivotal.io>2019-03-14 17:38:20 +0000
committerkjnilsson <knilsson@pivotal.io>2019-03-14 17:43:07 +0000
commitc46020f15646febe2d32653defa0e94e55ff144a (patch)
tree4ad19ae9f76bb624de540d6571fad9804170593d /test
parent7b71da6e9e0b5c9bd7fc3485fbb7cf2150516cff (diff)
downloadrabbitmq-server-git-c46020f15646febe2d32653defa0e94e55ff144a.tar.gz
Fix snapshot bug in rabbit_fifo
The waiting_consumers were not being "dehydrated" causing snapshots to potentially contain message bodies causing occasional test failures in the snapshots property tests.
Diffstat (limited to 'test')
-rw-r--r--test/rabbit_fifo_prop_SUITE.erl29
1 files changed, 26 insertions, 3 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl
index 4ce34c8a13..76b8d7e715 100644
--- a/test/rabbit_fifo_prop_SUITE.erl
+++ b/test/rabbit_fifo_prop_SUITE.erl
@@ -37,7 +37,8 @@ all_tests() ->
scenario13,
scenario14,
scenario15,
- scenario16
+ scenario16,
+ scenario17
].
groups() ->
@@ -270,6 +271,27 @@ scenario16(_Config) ->
delivery_limit => 1}, Commands),
ok.
+scenario17(_Config) ->
+ C1Pid = test_util:fake_pid(rabbit@fake_node1),
+ C1 = {<<0>>, C1Pid},
+ % C2Pid = test_util:fake_pid(fake_node1),
+ C2 = {<<>>, C1Pid},
+ E = test_util:fake_pid(rabbit@fake_node2),
+ Commands = [
+ make_checkout(C1, {auto,1,simple_prefetch}),
+ make_enqueue(E,1,<<"one">>),
+ make_checkout(C2, {auto,1,simple_prefetch}),
+ {down, C1Pid, noconnection},
+ make_checkout(C2, cancel),
+ make_enqueue(E,2,<<"two">>),
+ {nodeup,rabbit@fake_node1},
+ make_settle(C1, [0]),
+ make_settle(C1, [1])
+ ],
+ run_snapshot_test(#{name => ?FUNCTION_NAME,
+ single_active_consumer_on => true
+ }, Commands),
+ ok.
snapshots(_Config) ->
run_proper(
@@ -541,8 +563,9 @@ run_snapshot_test0(Conf, Commands) ->
State -> ok;
_ ->
ct:pal("Snapshot tests failed run log:~n"
- "~p~n from ~n~p~n Entries~n~p~n",
- [Filtered, SnapState, Entries]),
+ "~p~n from ~n~p~n Entries~n~p~n"
+ "Config: ~p~n",
+ [Filtered, SnapState, Entries, Conf]),
ct:pal("Expected~n~p~nGot:~n~p", [State, S]),
?assertEqual(State, S)
end