@@ -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,41 @@ 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_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
+
239
254
snapshots (_Config ) ->
240
255
run_proper (
241
256
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 }},
244
259
{5 , {non_neg_integer (), non_neg_integer (),
245
- boolean ()}}]),
260
+ boolean (), non_neg_integer () }}]),
246
261
? FORALL (O , ? LET (Ops , log_gen (200 ), expand (Ops )),
247
262
collect ({Length , Bytes },
248
263
snapshots_prop (
249
264
config (? FUNCTION_NAME ,
250
265
Length , Bytes ,
251
- SingleActiveConsumer ), O ))))
266
+ SingleActiveConsumer , DeliveryLimit ), O ))))
252
267
end , [], 2000 ).
253
268
254
- config (Name , Length , Bytes , SingleActive ) ->
269
+ config (Name , Length , Bytes , SingleActive , DeliveryLimit ) ->
255
270
#{name => Name ,
256
271
max_length => map_max (Length ),
257
272
max_bytes => map_max (Bytes ),
258
- single_active_consumer_on => SingleActive }.
273
+ single_active_consumer_on => SingleActive ,
274
+ delivery_limit => map_max (DeliveryLimit )}.
259
275
260
276
map_max (0 ) -> undefined ;
261
277
map_max (N ) -> N .
0 commit comments