summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyanda-D <ayanda.dube@erlang-solutions.com>2020-11-27 10:25:16 +0000
committerAyanda-D <ayanda.dube@erlang-solutions.com>2020-11-27 10:28:44 +0000
commit4a6bd67bc9398f2ad797935fef4fe9c11f85bfd4 (patch)
treee9307882494ce622c2ef3792d20a8c578dfb1f0c
parent0059fd724993d32dc94aa3ef837bbdb4d3ed1978 (diff)
downloadrabbitmq-server-git-4a6bd67bc9398f2ad797935fef4fe9c11f85bfd4.tar.gz
Add failing direct connection safe call timeout test/mock
-rw-r--r--deps/amqp_client/test/system_SUITE.erl19
1 files changed, 18 insertions, 1 deletions
diff --git a/deps/amqp_client/test/system_SUITE.erl b/deps/amqp_client/test/system_SUITE.erl
index 80eaaf751c..5d2ac8683a 100644
--- a/deps/amqp_client/test/system_SUITE.erl
+++ b/deps/amqp_client/test/system_SUITE.erl
@@ -379,7 +379,24 @@ safe_call_timeouts_test(Params = #amqp_params_direct{}) ->
net_kernel:set_net_ticktime(NetTicktime0, 1),
wait_until_net_ticktime(NetTicktime0),
?assertEqual(ok, amqp_connection:close(Connection3)),
- wait_for_death(Connection3).
+ wait_for_death(Connection3),
+
+ %% Failing direct connection
+ amqp_util:update_call_timeout(_LowCallTimeout = 1000),
+
+ ok = meck:new(amqp_direct_connection, [passthrough]),
+ ok = meck:expect(amqp_direct_connection, connect,
+ fun(_AmqpParams, _SIF, _TypeSup, _State) ->
+ timer:sleep(2000),
+ {error, test_connection_timeout}
+ end),
+
+ {error, test_connection_timeout} = amqp_connection:start(Params),
+
+ ?assertEqual((?DIRECT_OPERATION_TIMEOUT + ?CALL_TIMEOUT_DEVIATION),
+ amqp_util:call_timeout()),
+
+ meck:unload(amqp_direct_connection).
%% -------------------------------------------------------------------