summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-01-18 11:33:25 +0000
committerSimon MacMullen <simon@rabbitmq.com>2012-01-18 11:33:25 +0000
commit96bd52f53add44a099497633b679c2f9002640fe (patch)
tree16751f879f25e79c818fd02f8bee21a9018d4d56
parent13d710e3cfabbc2030127d7242205a0ee41aad55 (diff)
downloadrabbitmq-server-96bd52f53add44a099497633b679c2f9002640fe.tar.gz
Ignore bump_credit messages in rabbit_tests.
-rw-r--r--src/rabbit_tests.erl27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 9afb95b9..7205a99f 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -2222,14 +2222,25 @@ test_amqqueue(Durable) ->
#amqqueue { durable = Durable }.
with_fresh_variable_queue(Fun) ->
- ok = empty_test_queue(),
- VQ = variable_queue_init(test_amqqueue(true), false),
- S0 = rabbit_variable_queue:status(VQ),
- assert_props(S0, [{q1, 0}, {q2, 0},
- {delta, {delta, undefined, 0, undefined}},
- {q3, 0}, {q4, 0},
- {len, 0}]),
- _ = rabbit_variable_queue:delete_and_terminate(shutdown, Fun(VQ)),
+ Ref = make_ref(),
+ Me = self(),
+ %% Run in a separate process since rabbit_variable_queue will send
+ %% bump_credit messages and we want to ignore them
+ spawn(fun() ->
+ ok = empty_test_queue(),
+ VQ = variable_queue_init(test_amqqueue(true), false),
+ S0 = rabbit_variable_queue:status(VQ),
+ assert_props(S0, [{q1, 0}, {q2, 0},
+ {delta, {delta, undefined, 0, undefined}},
+ {q3, 0}, {q4, 0},
+ {len, 0}]),
+ _ = rabbit_variable_queue:delete_and_terminate(
+ shutdown, Fun(VQ)),
+ Me ! Ref
+ end),
+ receive
+ Ref -> ok
+ end,
passed.
publish_and_confirm(Q, Payload, Count) ->