summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkjnilsson <knilsson@pivotal.io>2019-01-08 14:34:36 +0000
committerkjnilsson <knilsson@pivotal.io>2019-01-08 14:34:36 +0000
commit267ee35abb51081a3a0a676b98d22b868720cc95 (patch)
tree4c0ddf65629be543f64cdc77acabb7ea53b141fa
parent16c5bbfc10904aca0df06ce42192b8f47edac1ba (diff)
downloadrabbitmq-server-git-267ee35abb51081a3a0a676b98d22b868720cc95.tar.gz
rabbit_fifo_props: handle impossible case
Enqueues cannot arrive for the same process after a down with noproc has been received. Filter out such events.
-rw-r--r--test/rabbit_fifo_prop_SUITE.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl
index 1af0d3b4b0..a8604b46af 100644
--- a/test/rabbit_fifo_prop_SUITE.erl
+++ b/test/rabbit_fifo_prop_SUITE.erl
@@ -259,7 +259,8 @@ handle_op({input_event, requeue}, #t{effects = Effs} = T) ->
_ ->
T
end;
-handle_op({input_event, Settlement}, #t{effects = Effs} = T) ->
+handle_op({input_event, Settlement}, #t{effects = Effs,
+ down = Down} = T) ->
case queue:out(Effs) of
{{value, {settle, MsgIds, CId}}, Q} ->
Cmd = case Settlement of
@@ -269,7 +270,14 @@ handle_op({input_event, Settlement}, #t{effects = Effs} = T) ->
end,
do_apply(Cmd, T#t{effects = Q});
{{value, Cmd}, Q} when element(1, Cmd) =:= enqueue ->
- do_apply(Cmd, T#t{effects = Q});
+ case maps:is_key(element(2, Cmd), Down) of
+ true ->
+ %% enqueues cannot arrive after down for the same process
+ %% drop message
+ T#t{effects = Q};
+ false ->
+ do_apply(Cmd, T#t{effects = Q})
+ end;
_ ->
T
end;