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

Skip to content

Commit e65ad0f

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

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

test/rabbit_fifo_prop_SUITE.erl

Lines changed: 21 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,39 @@ 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_return(C1, [0]),
246+
make_return(C1, [1])
247+
],
248+
run_snapshot_test(#{name => ?FUNCTION_NAME,
249+
delivery_limit => 1}, Commands),
250+
ok.
251+
239252
snapshots(_Config) ->
240253
run_proper(
241254
fun () ->
242-
?FORALL({Length, Bytes, SingleActiveConsumer},
243-
frequency([{10, {0, 0, false}},
255+
?FORALL({Length, Bytes, SingleActiveConsumer, DeliveryLimit},
256+
frequency([{10, {0, 0, false, 0}},
244257
{5, {non_neg_integer(), non_neg_integer(),
245-
boolean()}}]),
258+
boolean(), non_neg_integer()}}]),
246259
?FORALL(O, ?LET A30D (Ops, log_gen(200), expand(Ops)),
247260
collect({Length, Bytes},
248261
snapshots_prop(
249262
config(?FUNCTION_NAME,
250263
Length, Bytes,
251-
SingleActiveConsumer), O))))
264+
SingleActiveConsumer, DeliveryLimit), O))))
252265
end, [], 2000).
253266

254-
config(Name, Length, Bytes, SingleActive) ->
267+
config(Name, Length, Bytes, SingleActive, DeliveryLimit) ->
255268
#{name => Name,
256269
max_length => map_max(Length),
257270
max_bytes => map_max(Bytes),
258-
single_active_consumer_on => SingleActive}.
271+
single_active_consumer_on => SingleActive,
272+
delivery_limit => map_max(DeliveryLimit)}.
259273

260274
map_max(0) -> undefined;
261275
map_max(N) -> N.

0 commit comments

Comments
 (0)
0