summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-01-22 13:58:49 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2013-01-22 13:58:49 +0000
commita09d21e32b4147bab8e33a177a41fc68476e440a (patch)
treeab51b5d3f846dc1f83f18c3e4df356413c1b9207
parentc408184ffd653dc7b52fe584b9e13f410229e142 (diff)
downloadrabbitmq-server-bug25360.tar.gz
one test writer is quite enough. and make it work.bug25360
-rw-r--r--src/rabbit_tests.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 7a0ed1af..1e02ff6b 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -1084,16 +1084,9 @@ test_policy_validation() ->
rabbit_runtime_parameters_test:unregister_policy_validator(),
passed.
-writer() ->
- receive
- {'$gen_call', From, flush} -> gen_server:reply(From, ok),
- writer();
- shutdown -> ok
- end.
-
test_server_status() ->
%% create a few things so there is some useful information to list
- Writer = spawn(fun writer/0),
+ Writer = spawn(fun test_writer/0),
{ok, Ch} = rabbit_channel:start_link(
1, self(), Writer, self(), "", rabbit_framing_amqp_0_9_1,
user(<<"user">>), <<"/">>, [], self(),
@@ -1167,10 +1160,15 @@ test_server_status() ->
passed.
+test_writer() -> test_writer(none).
+
test_writer(Pid) ->
receive
- shutdown -> ok;
- {send_command, Method} -> Pid ! Method, test_writer(Pid)
+ {'$gen_call', From, flush} -> gen_server:reply(From, ok),
+ test_writer(Pid);
+ {send_command, Method} -> Pid ! Method,
+ test_writer(Pid);
+ shutdown -> ok
end.
test_spawn() ->