aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh
diff options
context:
space:
mode:
authorHans <[email protected]>2015-06-03 16:43:21 +0200
committerHans <[email protected]>2015-06-04 14:15:35 +0200
commitdef3336c4e7f1fd2210ded405263bcad293cdc25 (patch)
treebfb2acd91ce05814eace4824120bbfd5defd7690 /lib/ssh
parent99ccfe4d73b3ba82a8a461b53cb30cf512ee1bb9 (diff)
downloadotp-def3336c4e7f1fd2210ded405263bcad293cdc25.tar.gz
otp-def3336c4e7f1fd2210ded405263bcad293cdc25.tar.bz2
otp-def3336c4e7f1fd2210ded405263bcad293cdc25.zip
ssh: timeout fixes in ssh_basic_SUITE
The testcases ssh_connect_negtimeout_parallel ssh_connect_negtimeout_sequential max_sessions_sftp_start_channel_sequential max_sessions_sftp_start_channel_parallel max_sessions_ssh_connect_sequential max_sessions_ssh_connect_parallel sometimes failed on certain machines. Tried to increase timeouts and added a sleep. (Not exactly the best way of doing real time programming....)
Diffstat (limited to 'lib/ssh')
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index cff695681e..7eaf1b1b53 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -1199,8 +1199,9 @@ ssh_connect_negtimeout(Config, Parallel) ->
{failfun, fun ssh_test_lib:failfun/2}]),
{ok,Socket} = gen_tcp:connect(Host, Port, []),
- ct:pal("And now sleeping 1.2*NegTimeOut (~p ms)...", [round(1.2 * NegTimeOut)]),
- receive after round(1.2 * NegTimeOut) -> ok end,
+ Factor = 1.5,
+ ct:pal("And now sleeping ~p*NegTimeOut (~p ms)...", [Factor, round(Factor * NegTimeOut)]),
+ receive after round(Factor * NegTimeOut) -> ok end,
case inet:sockname(Socket) of
{ok,_} -> ct:fail("Socket not closed");
@@ -1243,8 +1244,11 @@ ssh_connect_nonegtimeout_connected(Config, Parallel) ->
ct:pal("---Erlang shell start: ~p~n", [ErlShellStart]),
one_shell_op(IO, NegTimeOut),
one_shell_op(IO, NegTimeOut),
- ct:pal("And now sleeping 1.2*NegTimeOut (~p ms)...", [round(1.2 * NegTimeOut)]),
- receive after round(1.2 * NegTimeOut) -> ok end,
+
+ Factor = 1.5,
+ ct:pal("And now sleeping ~p*NegTimeOut (~p ms)...", [Factor, round(Factor * NegTimeOut)]),
+ receive after round(Factor * NegTimeOut) -> ok end,
+
one_shell_op(IO, NegTimeOut)
end,
exit(Shell, kill).
@@ -1372,6 +1376,7 @@ max_sessions(Config, ParallelLogin, Connect0) when is_function(Connect0,2) ->
%% This is expected
%% Now stop one connection and try to open one more
ok = ssh:close(hd(Connections)),
+ receive after 250 -> ok end, % sleep so the supervisor has time to count down. Not nice...
try Connect(Host,Port)
of
_ConnectionRef1 ->