summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngela Anderton Andin <ingela@erlang.org>2022-09-19 16:56:56 +0200
committerIngela Anderton Andin <ingela@erlang.org>2022-09-21 15:32:20 +0200
commit0707990aec72cfb1c62bacfa85a4d32b9024f73b (patch)
tree4ebc37850538522e2dae829029b2da86876dea10
parent6efb5e31df6bc512ed6c466584ef15b846dcecab (diff)
downloaderlang-0707990aec72cfb1c62bacfa85a4d32b9024f73b.tar.gz
ssl: Cuddle timing issues
-rw-r--r--lib/ssl/test/openssl_cipher_suite_SUITE.erl2
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl18
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/ssl/test/openssl_cipher_suite_SUITE.erl b/lib/ssl/test/openssl_cipher_suite_SUITE.erl
index 14a1ee61b4..bf854d44a7 100644
--- a/lib/ssl/test/openssl_cipher_suite_SUITE.erl
+++ b/lib/ssl/test/openssl_cipher_suite_SUITE.erl
@@ -89,7 +89,7 @@
ecdhe_ecdsa_with_aes_256_ccm_8/1
]).
--define(DEFAULT_TIMEOUT, {seconds, 10}).
+-define(DEFAULT_TIMEOUT, {seconds, 15}).
%%--------------------------------------------------------------------
%% Common Test interface functions -----------------------------------
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index d46857d21e..db306419aa 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -785,7 +785,8 @@ user_dies(Config) when is_list(Config) ->
{ok, L} = ssl:listen(Port, ServerOpts),
loop(L)
end),
- {ok, _} = ssl:connect(Hostname, Port, ClientOpts),
+ do_wait_tls_server(Hostname, Port),
+ {ok,_} = ssl:connect(Hostname, Port, ClientOpts),
check_process_count(2),
Pid = spawn_link(fun() -> many_client_starter(Hostname, Port, ClientOpts, Server) end),
receive
@@ -1030,3 +1031,18 @@ check_process_count(Count, Try) ->
ct:sleep(500), %% Wait long enough
check_process_count(Count, Try - 1)
end.
+
+do_wait_tls_server(Hostname, Port) ->
+ do_wait_tls_server(Hostname, Port, 5).
+
+do_wait_tls_server(_,_, 0)->
+ ct:fail(to_connect_to_server);
+do_wait_tls_server(Hostname, Port, Try) ->
+ case gen_tcp:connect(Hostname, Port, []) of
+ {ok, S} ->
+ gen_tcp:close(S),
+ ok;
+ _ ->
+ ct:sleep(?SLEEP),
+ do_wait_tls_server(Hostname, Port, Try-1)
+ end.