summaryrefslogtreecommitdiff
path: root/lib/ssl/test
diff options
context:
space:
mode:
authorRaimo Niskanen <raimo@erlang.org>2023-02-01 16:32:14 +0100
committerRaimo Niskanen <raimo@erlang.org>2023-02-09 15:38:36 +0100
commit36c6091df342f635ec43c1ad3d850bc273af5377 (patch)
tree261f4daeea799b6b6677646daa966f07e2265c67 /lib/ssl/test
parent9c1e7826c5eb908a4549e2cdd7e5edabd58b31e0 (diff)
downloaderlang-36c6091df342f635ec43c1ad3d850bc273af5377.tar.gz
Skip concurrency test when there are too few schedulers
Diffstat (limited to 'lib/ssl/test')
-rw-r--r--lib/ssl/test/ssl_dist_SUITE.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index 70d43cbfd0..669b49895c 100644
--- a/lib/ssl/test/ssl_dist_SUITE.erl
+++ b/lib/ssl/test/ssl_dist_SUITE.erl
@@ -396,16 +396,20 @@ payload(Config) when is_list(Config) ->
dist_port_overload() ->
[{doc, "Test that TLS distribution connections can be accepted concurrently"}].
dist_port_overload(Config) when is_list(Config) ->
+ (RequiredConcurrency = 2) =< erlang:system_info(schedulers_online)
+ orelse
+ throw({skip, "Not enough schedulers online"}),
+ %%
%% Start a node, and get the port number it's listening on.
#node_handle{nodename = NodeName} = NH1 = start_ssl_node(Config),
[Name, Host] = string:lexemes(atom_to_list(NodeName), "@"),
{ok, NodesPorts} = apply_on_ssl_node(NH1, fun net_adm:names/0),
{Name, Port} = lists:keyfind(Name, 1, NodesPorts),
- %% Run 4 connections concurrently. When TLS handshake is not concurrent,
- %% and with default net_setuptime of 7 seconds, only one connection per 7
- %% seconds is closed from server side. With concurrent accept, all 7 will
- %% be dropped in 7 seconds
- RequiredConcurrency = 4,
+ %% Run RequiredConcurrency connections concurrently.
+ %% When TLS handshake is not concurrent,
+ %% and with default net_setuptime of 7 seconds,
+ %% only one connection per 7 seconds is closed from server side.
+ %% With concurrent accept they will be closed in parallel.
Started = [connect(self(), Host, Port) || _ <- lists:seq(1, RequiredConcurrency)],
%% give 10 seconds (more than 7, less than 2x7 seconds)
Responded = barrier(RequiredConcurrency, [], erlang:system_time(millisecond) + 10000),