Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
4121-Troubleshoot-failing-test-case.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4121-Troubleshoot-failing-test-case.patch of Package erlang
From ff93e4ab94ee038c17c17838e9400b87d58d7221 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Wed, 21 Sep 2022 11:49:45 +0200 Subject: [PATCH 01/27] Troubleshoot failing test case Add diagnostic printouts --- lib/ssl/test/ssl_dist_SUITE.erl | 52 ++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl index 79e4859b8c..c74e00773a 100644 --- a/lib/ssl/test/ssl_dist_SUITE.erl +++ b/lib/ssl/test/ssl_dist_SUITE.erl @@ -282,39 +282,60 @@ listen_port_options() -> listen_port_options(Config) when is_list(Config) -> %% Start a node, and get the port number it's listening on. NH1 = start_ssl_node(Config), + NH1Args = apply_on_ssl_node(NH1, init, get_arguments, []), + {ok, NH1NodesPorts} = apply_on_ssl_node(NH1, net_adm, names, []), + io:format( + "Node 1 Args: ~p~n" + "Node 1 NodesPorts: ~p~n" + "Node 1 SocketsInfo: ~p~n", + [NH1Args, NH1NodesPorts, + apply_on_ssl_node(NH1, fun sockets_info/0)]), + Node1 = NH1#node_handle.nodename, Name1 = lists:takewhile(fun(C) -> C =/= $@ end, atom_to_list(Node1)), - {ok, NodesPorts} = apply_on_ssl_node(NH1, fun net_adm:names/0), - {Name1, Port1} = lists:keyfind(Name1, 1, NodesPorts), - + {Name1, Port1} = lists:keyfind(Name1, 1, NH1NodesPorts), + %% Now start a second node, configuring it to use the same port %% number. PortOpt1 = "-kernel inet_dist_listen_min " ++ integer_to_list(Port1) ++ " inet_dist_listen_max " ++ integer_to_list(Port1), - - try start_ssl_node([{tls_verify_opts, PortOpt1} | proplists:delete(tls_verify_opts, Config)]) of - #node_handle{} -> + + try + start_ssl_node( + [{tls_verify_opts, PortOpt1} + | proplists:delete(tls_verify_opts, Config)]) + of + #node_handle{} = NH2x -> %% If the node was able to start, it didn't take the port %% option into account. + NH2xArgs = apply_on_ssl_node(NH2x, init, get_arguments, []), + {ok, NH2xNodesPorts} = apply_on_ssl_node(NH2x, net_adm, names, []), + io:format( + "Node 2x Args: ~p~n" + "Node 2x NodesPorts: ~p~n" + "Node 2x SocketsInfo: ~p~n", + [NH2xArgs, NH2xNodesPorts, + apply_on_ssl_node(NH2x, fun sockets_info/0)]), stop_ssl_node(NH1), + stop_ssl_node(NH2x), exit(unexpected_success) catch exit:{accept_failed, timeout} -> %% The node failed to start, as expected. ok end, - + %% Try again, now specifying a high max port. PortOpt2 = "-kernel inet_dist_listen_min " ++ integer_to_list(Port1) ++ " inet_dist_listen_max 65535", NH2 = start_ssl_node([{tls_verify_opts, PortOpt2} | proplists:delete(tls_verify_opts, Config)]), - - try + + try Node2 = NH2#node_handle.nodename, Name2 = lists:takewhile(fun(C) -> C =/= $@ end, atom_to_list(Node2)), {ok, NodesPorts2} = apply_on_ssl_node(NH2, fun net_adm:names/0), {Name2, Port2} = lists:keyfind(Name2, 1, NodesPorts2), - + %% The new port should be higher: if Port2 > Port1 -> ok; @@ -331,6 +352,17 @@ listen_port_options(Config) when is_list(Config) -> stop_ssl_node(NH1), success(Config). +sockets_info() -> + [{element(2, inet:sockname(Socket)), + element(2, inet:peername(Socket)), + element(2, prim_inet:getstatus(Socket))} + || + Socket <- + lists:filter( + fun (Port) -> + erlang:port_info(Port, name) =:= {name, "tcp_inet"} + end, erlang:ports())]. + %%-------------------------------------------------------------------- listen_options() -> [{doc, "Test inet_dist_listen_options"}]. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor