summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-01-19 14:43:56 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2013-01-19 14:43:56 +0000
commita4891ce1d6006c6f36c8408d96028b7b3ee35be9 (patch)
tree132196c9c376bb197a33f6cde9bf9385ab7e51ed
parentee6e1d0f90be6b2515471d7ee9e0e3989897e8c2 (diff)
downloadrabbitmq-server-bug25409.tar.gz
add a testbug25409
-rw-r--r--src/rabbit_tests.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 13454d31..7bd8d541 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -2323,6 +2323,7 @@ test_variable_queue() ->
fun test_dropwhile_varying_ram_duration/1,
fun test_fetchwhile_varying_ram_duration/1,
fun test_variable_queue_ack_limiting/1,
+ fun test_variable_queue_purge/1,
fun test_variable_queue_requeue/1,
fun test_variable_queue_fold/1]],
passed.
@@ -2418,6 +2419,21 @@ test_variable_queue_requeue(VQ0) ->
{empty, VQ3} = rabbit_variable_queue:fetch(true, VQ2),
VQ3.
+test_variable_queue_purge(VQ0) ->
+ LenDepth = fun (VQ) ->
+ {rabbit_variable_queue:len(VQ),
+ rabbit_variable_queue:depth(VQ)}
+ end,
+ VQ1 = variable_queue_publish(false, 10, VQ0),
+ {VQ2, Acks} = variable_queue_fetch(6, false, false, 10, VQ1),
+ {4, VQ3} = rabbit_variable_queue:purge(VQ2),
+ {0, 6} = LenDepth(VQ3),
+ {_, VQ4} = rabbit_variable_queue:requeue(lists:sublist(Acks, 2), VQ3),
+ {2, 6} = LenDepth(VQ4),
+ VQ5 = rabbit_variable_queue:purge_acks(VQ4),
+ {2, 2} = LenDepth(VQ5),
+ VQ5.
+
test_variable_queue_ack_limiting(VQ0) ->
%% start by sending in a bunch of messages
Len = 1024,