aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test/ssl_test_lib.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-09-22 16:26:32 +0200
committerIngela Anderton Andin <[email protected]>2015-09-23 18:19:26 +0200
commite67f7ea7d62d8addc0a06447ddb28d425d3f650d (patch)
tree597839637a2f34b7ef48dbf94a9f5c9eeba6b6dd /lib/ssl/test/ssl_test_lib.erl
parent1523be48ab4071b158412f4b06fe9c8d6ba3e73c (diff)
downloadotp-e67f7ea7d62d8addc0a06447ddb28d425d3f650d.tar.gz
otp-e67f7ea7d62d8addc0a06447ddb28d425d3f650d.tar.bz2
otp-e67f7ea7d62d8addc0a06447ddb28d425d3f650d.zip
ssl: Retry ssl connections on econnreset errors
To avoid test case failure due to test case setup timing issues. Suspected problem is that the listen queue builds up to quickly in client_unique_session test when running on slow computers.
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r--lib/ssl/test/ssl_test_lib.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index ba8588f2f9..f25f6f9425 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -226,6 +226,17 @@ run_client(Opts) ->
ct:log("~p:~p~nClient faild several times: connection failed: ~p ~n", [?MODULE,?LINE, Reason]),
Pid ! {self(), {error, Reason}}
end;
+ {error, econnreset = Reason} ->
+ case get(retries) of
+ N when N < 5 ->
+ ct:log("~p:~p~neconnreset retries=~p sleep ~p",[?MODULE,?LINE, N,?SLEEP]),
+ put(retries, N+1),
+ ct:sleep(?SLEEP),
+ run_client(Opts);
+ _ ->
+ ct:log("~p:~p~nClient faild several times: connection failed: ~p ~n", [?MODULE,?LINE, Reason]),
+ Pid ! {self(), {error, Reason}}
+ end;
{error, Reason} ->
ct:log("~p:~p~nClient: connection failed: ~p ~n", [?MODULE,?LINE, Reason]),
Pid ! {connect_failed, Reason};