diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2019-02-19 11:15:31 +0000 |
|---|---|---|
| committer | kjnilsson <knilsson@pivotal.io> | 2019-02-22 14:14:31 +0000 |
| commit | 6980462e6d373e567485668420b25356fc884e1d (patch) | |
| tree | a7b8538f125cfc5842d03a23ac66d8f69a83b1e2 | |
| parent | 8a3d3e654b66a3fa53b45bd949b92accf19974da (diff) | |
| download | rabbitmq-server-git-6980462e6d373e567485668420b25356fc884e1d.tar.gz | |
Include poison message handling in snapshot testing
[#163513253]
| -rw-r--r-- | test/rabbit_fifo_prop_SUITE.erl | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl index 437cd02e25..b58cc9ced0 100644 --- a/test/rabbit_fifo_prop_SUITE.erl +++ b/test/rabbit_fifo_prop_SUITE.erl @@ -35,7 +35,8 @@ all_tests() -> scenario11, scenario12, scenario13, - scenario14 + scenario14, + scenario15 ]. groups() -> @@ -236,26 +237,41 @@ scenario14(_Config) -> max_bytes => 1}, Commands), ok. +scenario15(_Config) -> + C1 = {<<>>, c:pid(0,179,1)}, + E = c:pid(0,176,1), + Commands = [make_checkout(C1, {auto,2,simple_prefetch}), + make_enqueue(E, 1, msg1), + make_enqueue(E, 2, msg2), + make_return(C1, [0]), + make_return(C1, [2]), + make_settle(C1, [1]) + ], + run_snapshot_test(#{name => ?FUNCTION_NAME, + delivery_limit => 1}, Commands), + ok. + snapshots(_Config) -> run_proper( fun () -> - ?FORALL({Length, Bytes, SingleActiveConsumer}, - frequency([{10, {0, 0, false}}, + ?FORALL({Length, Bytes, SingleActiveConsumer, DeliveryLimit}, + frequency([{10, {0, 0, false, 0}}, {5, {non_neg_integer(), non_neg_integer(), - boolean()}}]), + boolean(), non_neg_integer()}}]), ?FORALL(O, ?LET(Ops, log_gen(200), expand(Ops)), collect({Length, Bytes}, snapshots_prop( config(?FUNCTION_NAME, Length, Bytes, - SingleActiveConsumer), O)))) + SingleActiveConsumer, DeliveryLimit), O)))) end, [], 2000). -config(Name, Length, Bytes, SingleActive) -> +config(Name, Length, Bytes, SingleActive, DeliveryLimit) -> #{name => Name, max_length => map_max(Length), max_bytes => map_max(Bytes), - single_active_consumer_on => SingleActive}. + single_active_consumer_on => SingleActive, + delivery_limit => map_max(DeliveryLimit)}. map_max(0) -> undefined; map_max(N) -> N. |
