summaryrefslogtreecommitdiff
path: root/test/rabbit_fifo_prop_SUITE.erl
diff options
context:
space:
mode:
authorkjnilsson <knilsson@pivotal.io>2019-02-22 12:39:35 +0000
committerkjnilsson <knilsson@pivotal.io>2019-02-22 14:14:31 +0000
commit9e9eeb5fc6b35784bd1b6de110f6b58ce965fe8c (patch)
treee705c61bdcda95162f72cf059dd0b1a459eec8ab /test/rabbit_fifo_prop_SUITE.erl
parent723972b3cbdf63e836c26150540b868833f30df8 (diff)
downloadrabbitmq-server-git-9e9eeb5fc6b35784bd1b6de110f6b58ce965fe8c.tar.gz
Add nodeup commands to rabbit_fifo_prop
So that nodeups also can stand a chance to be tested
Diffstat (limited to 'test/rabbit_fifo_prop_SUITE.erl')
-rw-r--r--test/rabbit_fifo_prop_SUITE.erl22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl
index dd56659bda..da72c030cd 100644
--- a/test/rabbit_fifo_prop_SUITE.erl
+++ b/test/rabbit_fifo_prop_SUITE.erl
@@ -328,8 +328,12 @@ snapshots_prop(Conf, Commands) ->
end.
log_gen(Size) ->
- ?LET(EPids, vector(2, pid_gen()),
- ?LET(CPids, vector(2, pid_gen()),
+ Nodes = [node(),
+ fakenode@fake,
+ fakenode@fake2
+ ],
+ ?LET(EPids, vector(2, pid_gen(Nodes)),
+ ?LET(CPids, vector(2, pid_gen(Nodes)),
resize(Size,
list(
frequency(
@@ -342,18 +346,20 @@ log_gen(Size) ->
{2, checkout_gen(oneof(CPids))},
{1, checkout_cancel_gen(oneof(CPids))},
{1, down_gen(oneof(EPids ++ CPids))},
+ {1, nodeup_gen(Nodes)},
{1, purge}
]))))).
-pid_gen() ->
- ?LET(Node, oneof([atom_to_binary(node(), utf8),
- <<"fakenode@fake">>,
- <<"fakenode@fake2">>
- ]), fake_external_pid(Node)).
+pid_gen(Nodes) ->
+ ?LET(Node, oneof(Nodes),
+ fake_external_pid(atom_to_binary(Node, utf8))).
down_gen(Pid) ->
?LET(E, {down, Pid, oneof([noconnection, noproc])}, E).
+nodeup_gen(Nodes) ->
+ {nodeup, oneof(Nodes)}.
+
enqueue_gen(Pid) ->
?LET(E, {enqueue, Pid,
frequency([{10, enqueue},
@@ -451,6 +457,8 @@ handle_op({down, Pid, Reason} = Cmd, #t{down = Down} = T) ->
%% it is either not down or down with noconnection
do_apply(Cmd, T#t{down = maps:put(Pid, Reason, Down)})
end;
+handle_op({nodeup, _} = Cmd, T) ->
+ do_apply(Cmd, T);
handle_op({input_event, requeue}, #t{effects = Effs} = T) ->
%% this simulates certain settlements arriving out of order
case queue:out(Effs) of