8000 Include poison message handling in snapshot testing · rabbitmq/rabbitmq-server@e9ccbe4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e9ccbe4

Browse files
committed
Include poison message handling in snapshot testing
[#163513253]
1 parent affefe1 commit e9ccbe4

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

test/rabbit_fifo_prop_SUITE.erl

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ all_tests() ->
3535
scenario11,
3636
scenario12,
3737
scenario13,
38-
scenario14
38+
scenario14,
39+
scenario15
3940
].
4041

4142
groups() ->
@@ -236,26 +237,41 @@ scenario14(_Config) ->
236237
max_bytes => 1}, Commands),
237238
ok.
238239

240+
scenario15(_Config) ->
241+
C1 = {<<>>, c:pid(0,179,1)},
242+
E = c:pid(0,176,1),
243+
Commands = [make_checkout(C1, {auto,2,simple_prefetch}),
244+
make_enqueue(E, 1, msg1),
245+
make_enqueue(E, 2, msg2),
246+
make_return(C1, [0]),
247+
make_return(C1, [2]),
248+
make_settle(C1, [1])
249+
],
250+
run_snapshot_test(#{name => ?FUNCTION_NAME,
251+
delivery_limit => 1}, Commands),
252+
ok.
253+
239254
snapshots(_Config) ->
240255
run_proper(
241256
fun () ->
242-
?FORALL({Length, Bytes, SingleActiveConsumer},
243-
frequency([{10, {0, 0, false}},
257+
?FORALL({Length, Bytes, SingleActiveConsumer, DeliveryLimit},
258+
frequency([{10, {0, 0, false, 0}},
244259
{5, {non_neg_integer(), non_neg_integer(),
245-
boolean()}}]),
260+
boolean(), non_neg_integer()}}]),
246261
?FORALL(O, ?LET(Ops, log_gen(200), expand(Ops)),
247262
collect({Length, Bytes},
248263
snapshots_prop(
249264
config(?FUNCTION_NAME,
250265
Length, Bytes,
251-
SingleActiveConsumer), O))))
266+
SingleActiveConsumer, DeliveryLimit), O))))
252267
end, [], 2000).
253268

254-
config(Name, Length, Bytes, SingleActive) ->
269+
config(Name, Length, Bytes, SingleActive, DeliveryLimit) ->
255270
#{name => Name,
256271
max_length => map_max(Length),
257272
max_bytes => map_max(Bytes),
258-
single_active_consumer_on => SingleActive}.
273+
single_active_consumer_on => SingleActive,
274+
delivery_limit => map_max(DeliveryLimit)}.
259275

260276
map_max(0) -> undefined;
261277
map_max(N) -> N.

0 commit comments

Comments
 (0)
0