Test `rpc_client`: Add assertions to rpc_correlation_server/2

There are transient failures on Jenkins and Travis. Hopefully, it will
help debug them.
This commit is contained in:
Jean-Sébastien Pédron 2016-04-04 14:43:21 +02:00
parent a9265d48af
commit 54dea61f40
1 changed files with 12 additions and 7 deletions

View File

@ -799,13 +799,18 @@ rpc_client(Config) ->
%% Consumer of RPC requests that replies with the CorrelationId.
rpc_correlation_server(Channel, Q) ->
amqp_channel:register_return_handler(Channel, self()),
amqp_channel:call(Channel, #'queue.declare'{queue = Q}),
amqp_channel:call(Channel, #'basic.consume'{queue = Q,
consumer_tag = <<"server">>}),
rpc_client_consume_loop(Channel),
amqp_channel:call(Channel, #'basic.cancel'{consumer_tag = <<"server">>}),
amqp_channel:unregister_return_handler(Channel).
ok = amqp_channel:register_return_handler(Channel, self()),
#'queue.declare_ok'{queue = Q} =
amqp_channel:call(Channel, #'queue.declare'{queue = Q}),
#'basic.consume_ok'{} =
amqp_channel:call(Channel,
#'basic.consume'{queue = Q,
consumer_tag = <<"server">>}),
ok = rpc_client_consume_loop(Channel),
#'basic.cancel_ok'{} =
amqp_channel:call(Channel,
#'basic.cancel'{consumer_tag = <<"server">>}),
ok = amqp_channel:unregister_return_handler(Channel).
rpc_client_consume_loop(Channel) ->
receive