diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 4831f3da9aaf..89d081bf542f 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -203,7 +203,7 @@ init_per_testcase(api_connectx_init = Case, Config) -> init_per_testcase(t_simple_local_sockaddr_in_connectx_init = Case, Config) -> check_sctp_connectx(Case, Config); init_per_testcase(names_multihoming_ipv4 = Case, Config) -> - case lists:keylookup(label, 1, Config) of + case lists:keysearch(label, 1, Config) of {value, {label, docker}} -> {skip, "Unstable/broken on docker"}; _ -> @@ -2879,16 +2879,22 @@ s_start(Starter, Timeout) -> s_loop(Socket, Timeout, Parent, State) -> receive {?MODULE,AMref,{controlling_process, NewParent}} -> + ?P("received (new) controlling process: " + "~n ~p", [NewParent]), AMref ! {?MODULE,AMref,ok}, s_loop(Socket, Timeout, NewParent, State); {?MODULE,AMref,close} -> % socket_close() + ?P("received close"), erlang:send_after(Timeout, self(), {?MODULE,AMref,exit}), s_loop(Socket, Timeout, Parent, State); {?MODULE,AMref,exit} -> + ?P("received exit"), ok = gen_sctp:close(Socket), NewState = gb_push(exit, Socket, State), AMref ! {?MODULE,AMref,{NewState,flush()}}; {?MODULE,AMref,{Req}} -> + ?P("received request: " + "~n ~p", [Req]), Result = s_handle_req(Socket, Req), NewState = gb_push(req, {Req,Result}, State), AMref ! {?MODULE, AMref,Result}, @@ -2899,6 +2905,9 @@ s_loop(Socket, Timeout, Parent, State) -> {sctp,Socket,Addr,Port, {[#sctp_sndrcvinfo{stream=Stream,assoc_id=AssocId}=SRI],Data}} when not is_tuple(Data) -> + ?P("received [sctp] snd/rcv info: " + "~n Stream: ~p" + "~n AssocId: ~p", [Stream, AssocId]), case gb_get({assoc_change,AssocId}, State) of [{Addr,Port, #sctp_assoc_change{ @@ -2914,6 +2923,10 @@ s_loop(Socket, Timeout, Parent, State) -> s_loop(Socket, Timeout, Parent, NewState); {sctp,Socket,Addr,Port, {SRI,#sctp_assoc_change{assoc_id=AssocId,state=St}=SAC}} -> + ?P("received [sctp] assoc change: " + "~n AssocId: ~p" + "~n St: ~p" + "~n SRI: ~p", [AssocId, St, SRI]), case SRI of [#sctp_sndrcvinfo{assoc_id=AssocId,stream=0}] -> ok; [] -> ok @@ -2932,6 +2945,10 @@ s_loop(Socket, Timeout, Parent, State) -> {SRI,#sctp_paddr_change{assoc_id=AssocId, addr={_,P}, state=St}=SPC}} -> + ?P("received [sctp] paddr change: " + "~n AssocId: ~p" + "~n P: ~p" + "~n St: ~p", [AssocId, P, St]), match_unless_solaris(Port, P), case SRI of [#sctp_sndrcvinfo{assoc_id=AssocId,stream=0}] -> ok; @@ -2949,6 +2966,9 @@ s_loop(Socket, Timeout, Parent, State) -> s_loop(Socket, Timeout, Parent, NewState); {sctp,Socket,Addr,Port, {SRI,#sctp_shutdown_event{assoc_id=AssocId}=SSE}} -> + ?P("received [sctp] shutdown event: " + "~n AssocId: ~p" + "~n SRI: ~p", [AssocId, SRI]), case SRI of [#sctp_sndrcvinfo{assoc_id=AssocId,stream=0}] -> ok; [] -> ok @@ -2963,6 +2983,11 @@ s_loop(Socket, Timeout, Parent, State) -> again(Socket), s_loop(Socket, Timeout, Parent, NewState); Unexpected -> + ?P("received unexpected message: " + "~n ~p" + "~nwhen" + "~n Socket Info: ~p", + [Unexpected, inet:info(Socket)]), erlang:error({unexpected,Unexpected}) end. diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index a3f7f4ebc832..8123aabc0795 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -8411,6 +8411,8 @@ bidirectional_traffic(Config) when is_list(Config) -> true -> {skip, "Inet driver specific test"}; false -> + %% Unstable on our Solaris/SunOS machine(s) + is_not_sunos(), ok end end, @@ -9519,7 +9521,24 @@ is_platform(Family, Name, PlatformStr) _ -> skip("Require " ++ PlatformStr) end. - + +is_not_sunos() -> + is_not_unix(sunos, "SunOS"). + +is_not_unix(Name, PlatformStr) -> + is_not_platform(unix, Name, PlatformStr). + +is_not_platform(Family, Name, PlatformStr) + when is_atom(Family) andalso + is_atom(Name) andalso + is_list(PlatformStr) -> + case os:type() of + {Family, Name} -> + skip("Require *not* " ++ PlatformStr); + _ -> + ok + end. + is_socket_supported() -> try socket:info() of diff --git a/lib/kernel/test/kernel_test_lib.erl b/lib/kernel/test/kernel_test_lib.erl index 952f1e2e7599..dd5c4979e881 100644 --- a/lib/kernel/test/kernel_test_lib.erl +++ b/lib/kernel/test/kernel_test_lib.erl @@ -49,6 +49,8 @@ -export([ proxy_call/3, + ensure_not_dog_slow/2, + %% Generic 'has support' test function(s) is_socket_supported/0, has_support_ipv4/0, @@ -2709,6 +2711,16 @@ proxy_call(F, Timeout, Default) +ensure_not_dog_slow(Config, Limit) -> + Key = kernel_factor, + case lists:keysearch(Key, 1, Config) of + {value, {Key, Value}} when (Value > Limit) -> + skip({factor_limit, Value, Limit}); + _ -> + ok + end. + + %% This is an extremely simple check... has_support_ipv4() -> case which_local_addr(inet) of diff --git a/lib/kernel/test/kernel_test_lib.hrl b/lib/kernel/test/kernel_test_lib.hrl index 3efb009e7f36..2724693902d8 100644 --- a/lib/kernel/test/kernel_test_lib.hrl +++ b/lib/kernel/test/kernel_test_lib.hrl @@ -56,6 +56,8 @@ -define(WHICH_INET_BACKEND(C), ?LIB:which_inet_backend(C)). -define(IS_SOCKET_BACKEND(C), ?LIB:is_socket_backend(C)). +-define(ENSURE_NOT_DOG_SLOW(C, L), ?LIB:ensure_not_dog_slow((C), (L))). + -define(HAS_SUPPORT_IPV4(), ?LIB:has_support_ipv4()). -define(HAS_SUPPORT_IPV6(), ?LIB:has_support_ipv6()). -define(WHICH_LOCAL_ADDR(D), ?LIB:which_local_addr((D))). diff --git a/lib/kernel/test/net_SUITE.erl b/lib/kernel/test/net_SUITE.erl index 12eb8982db92..1760094935db 100644 --- a/lib/kernel/test/net_SUITE.erl +++ b/lib/kernel/test/net_SUITE.erl @@ -462,8 +462,11 @@ api_b_getservbyname() -> wrong_port("amqp", tcp, WrongPort, 5672); {error, Reason} -> case os:type() of - {unix, openbsd} - when (Reason =:= einval) -> + {unix, Flavor} + when ((Flavor =:= openbsd) orelse + (Flavor =:= solaris) orelse + (Flavor =:= sunos)) andalso + (Reason =:= einval) -> ok; _ -> ?P("Unexpected failure: ~p", @@ -480,11 +483,12 @@ api_b_getservbyname() -> wrong_port("amqp", sctp, WrongPort, 5672); {error, Reason} -> case os:type() of - {unix, darwin} - when (Reason =:= einval) -> - ok; - {unix, openbsd} - when (Reason =:= einval) -> + {unix, Flavor} + when ((Flavor =:= darwin) orelse + (Flavor =:= openbsd) orelse + (Flavor =:= solaris) orelse + (Flavor =:= sunos)) andalso + (Reason =:= einval) -> ok; _ -> ?P("Unexpected failure: ~p", @@ -642,8 +646,11 @@ api_b_getservbyport() -> WrongService, "amqp"); {error, Reason} -> case os:type() of - {unix, openbsd} - when (Reason =:= einval) -> + {unix, Flavor} + when ((Flavor =:= openbsd) orelse + (Flavor =:= solaris) orelse + (Flavor =:= sunos)) andalso + (Reason =:= einval) -> ok; _ -> ?P("Unexpected failure: ~p", @@ -661,9 +668,11 @@ api_b_getservbyport() -> WrongService, "amqp"); {error, Reason} when (Reason =:= einval) -> case os:type() of - {unix, UNIX} - when (UNIX =:= darwin) orelse - (UNIX =:= openbsd) -> + {unix, Flavor} + when (Flavor =:= darwin) orelse + (Flavor =:= openbsd) orelse + (Flavor =:= solaris) orelse + (Flavor =:= sunos) -> ok; _ -> ?P("Unexpected failure: ~p", diff --git a/lib/kernel/test/socket_SUITE.erl b/lib/kernel/test/socket_SUITE.erl index 1a6478b54968..cfa28090fce3 100644 --- a/lib/kernel/test/socket_SUITE.erl +++ b/lib/kernel/test/socket_SUITE.erl @@ -413,6 +413,8 @@ init_per_suite(Config0) -> ?P("init_per_suite -> end when " "~n Config: ~p", [Config1]), + ?ENSURE_NOT_DOG_SLOW(Config1, 15), + %% We need a monitor on this node also kernel_test_sys_monitor:start(), @@ -12787,8 +12789,12 @@ start_node(Name, Timeout) when is_integer(Timeout) andalso (Timeout > 0) -> ?SEV_IPRINT("Started node ~p - now (global) sync", [Name]), global:sync(), % Again, just in case... ?SEV_IPRINT("ping proxy"), - pong = ?PPING(Node), - {Peer, Node}; + case ?PPING(Node) of + {error, Reason} -> + skip({ping_failed, Reason}); + pong -> + {Peer, Node} + end; {error, Reason} -> ?SEV_EPRINT("failed starting node ~p (=> SKIP):" "~n ~p", [Name, Reason]), diff --git a/lib/kernel/test/socket_traffic_SUITE.erl b/lib/kernel/test/socket_traffic_SUITE.erl index 28617362909a..c8062972a071 100644 --- a/lib/kernel/test/socket_traffic_SUITE.erl +++ b/lib/kernel/test/socket_traffic_SUITE.erl @@ -475,6 +475,7 @@ traffic_send_and_recv_counters_sctp4(_Config) when is_list(_Config) -> ?TT(?SECS(15)), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv4(), has_support_sctp() end, @@ -497,6 +498,7 @@ traffic_send_and_recv_counters_sctp6(_Config) when is_list(_Config) -> ?TT(?SECS(15)), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv6(), has_support_sctp() end, @@ -612,6 +614,7 @@ traffic_sendmsg_and_recvmsg_counters_sctp4(_Config) when is_list(_Config) -> ?TT(?SECS(15)), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), is_not_windows(), has_support_ipv4(), has_support_sctp() @@ -645,6 +648,7 @@ traffic_sendmsg_and_recvmsg_counters_sctp6(_Config) when is_list(_Config) -> ?TT(?SECS(15)), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), is_not_windows(), has_support_ipv6(), has_support_sctp() @@ -2770,6 +2774,7 @@ traffic_send_and_recv_chunks_sctp4(_Config) when is_list(_Config) -> ?TT(?SECS(30)), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv4(), has_support_sctp() end, @@ -2792,6 +2797,7 @@ traffic_send_and_recv_chunks_sctp6(_Config) when is_list(_Config) -> ?TT(?SECS(30)), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv6(), has_support_sctp() end, @@ -3903,6 +3909,7 @@ traffic_ping_pong_small_send_and_recv_sctp4(Config) when is_list(Config) -> Num = ?TPP_NUM(Config, ?TPP_SMALL_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv4(), has_support_sctp() end, @@ -3932,6 +3939,7 @@ traffic_ping_pong_small_send_and_recv_sctp6(Config) when is_list(Config) -> Num = ?TPP_NUM(Config, ?TPP_SMALL_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv6(), has_support_sctp() end, @@ -4037,6 +4045,7 @@ traffic_ping_pong_medium_send_and_recv_sctp4(Config) when is_list(Config) -> Num = ?TPP_NUM(Config, ?TPP_MEDIUM_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv4(), has_support_sctp() end, @@ -4065,6 +4074,7 @@ traffic_ping_pong_medium_send_and_recv_sctp6(Config) when is_list(Config) -> Num = ?TPP_NUM(Config, ?TPP_MEDIUM_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), has_support_ipv6(), has_support_sctp() end, @@ -4180,10 +4190,11 @@ traffic_ping_pong_large_send_and_recv_sctp4(Config) when is_list(Config) -> Num = ?TPP_NUM(Config, ?TPP_LARGE_NUM), tc_try(?FUNCTION_NAME, fun() -> - has_support_ipv4(), - has_support_sctp(), + is_not_flakey_os(), is_old_fedora16(), is_slow_ubuntu(Config), + has_support_ipv4(), + has_support_sctp(), traffic_ping_pong_large_host_cond() end, fun() -> @@ -4212,10 +4223,11 @@ traffic_ping_pong_large_send_and_recv_sctp6(Config) when is_list(Config) -> Num = ?TPP_NUM(Config, ?TPP_LARGE_NUM), tc_try(?FUNCTION_NAME, fun() -> - has_support_ipv6(), - has_support_sctp(), + is_not_flakey_os(), is_old_fedora16(), - is_slow_ubuntu(Config) + is_slow_ubuntu(Config), + has_support_ipv6(), + has_support_sctp() end, fun() -> InitState = #{domain => inet6, @@ -4501,6 +4513,7 @@ traffic_ping_pong_small_sendmsg_and_recvmsg_sctp4(Config) Num = ?TPP_NUM(Config, ?TPP_SMALL_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), is_not_windows(), has_support_ipv4(), has_support_sctp() @@ -4531,6 +4544,7 @@ traffic_ping_pong_small_sendmsg_and_recvmsg_sctp6(Config) Num = ?TPP_NUM(Config, ?TPP_SMALL_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), is_not_windows(), has_support_ipv6(), has_support_sctp() @@ -4647,6 +4661,7 @@ traffic_ping_pong_medium_sendmsg_and_recvmsg_sctp4(Config) Num = ?TPP_NUM(Config, ?TPP_MEDIUM_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), is_not_windows(), has_support_ipv4(), has_support_sctp() @@ -4677,6 +4692,7 @@ traffic_ping_pong_medium_sendmsg_and_recvmsg_sctp6(Config) Num = ?TPP_NUM(Config, ?TPP_MEDIUM_NUM), tc_try(?FUNCTION_NAME, fun() -> + is_not_flakey_os(), is_not_windows(), has_support_ipv6(), has_support_sctp() @@ -4806,6 +4822,7 @@ traffic_ping_pong_large_sendmsg_and_recvmsg_sctp4(Config) tc_try(?FUNCTION_NAME, fun() -> is_not_windows(), + is_not_flakey_os(), has_support_ipv4(), has_support_sctp(), traffic_ping_pong_large_sendmsg_and_recvmsg_cond() @@ -4837,6 +4854,7 @@ traffic_ping_pong_large_sendmsg_and_recvmsg_sctp6(Config) tc_try(?FUNCTION_NAME, fun() -> is_not_windows(), + is_not_flakey_os(), has_support_ipv6(), has_support_sctp(), traffic_ping_pong_large_sendmsg_and_recvmsg_cond() @@ -7050,6 +7068,17 @@ is_not_windows() -> ok end. +is_not_flakey_os() -> + is_not_flakey_os(erlang:system_info(system_architecture)). + +is_not_flakey_os("sparc-sun-solaris2.10") -> + skip('flakey os'); +is_not_flakey_os("x86_64-pc-solaris2.11") -> + skip('flakey os'); +is_not_flakey_os(_) -> + ok. + + has_support_unix_domain_socket() -> case socket:is_supported(local) of true ->