@@ -35,7 +35,8 @@ all_tests() ->
35
35
scenario11 ,
36
36
scenario12 ,
37
37
scenario13 ,
38
- scenario14
38
+ scenario14 ,
39
+ scenario15
39
40
].
40
41
41
42
groups () ->
@@ -236,26 +237,39 @@ scenario14(_Config) ->
236
237
max_bytes => 1 }, Commands ),
237
238
ok .
238
239
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
+
239
252
snapshots (_Config ) ->
240
253
run_proper (
241
254
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 }},
244
257
{5 , {non_neg_integer (), non_neg_integer (),
245
- boolean ()}}]),
258
+ boolean (), non_neg_integer () }}]),
246
259
? FORALL (O , ? LET
A30D
(Ops , log_gen (200 ), expand (Ops )),
247
260
collect ({Length , Bytes },
248
261
snapshots_prop (
249
262
config (? FUNCTION_NAME ,
250
263
Length , Bytes ,
251
- SingleActiveConsumer ), O ))))
264
+ SingleActiveConsumer , DeliveryLimit ), O ))))
252
265
end , [], 2000 ).
253
266
254
- config (Name , Length , Bytes , SingleActive ) ->
267
+ config (Name , Length , Bytes , SingleActive , DeliveryLimit ) ->
255
268
#{name => Name ,
256
269
max_length => map_max (Length ),
257
270
max_bytes => map_max (Bytes ),
258
- single_active_consumer_on => SingleActive }.
271
+ single_active_consumer_on => SingleActive ,
272
+ delivery_limit => map_max (DeliveryLimit )}.
259
273
260
274
map_max (0 ) -> undefined ;
261
275
map_max (N ) -> N .
0 commit comments