diff options
author | Raimo Niskanen <raimo@erlang.org> | 2021-08-25 16:11:25 +0200 |
---|---|---|
committer | Raimo Niskanen <raimo@erlang.org> | 2021-08-25 16:11:25 +0200 |
commit | 9657eb547df68112ffb901baade6cb9b22379445 (patch) | |
tree | 2513a49c23440c93fcef89e1318c0aa543831e4a | |
parent | ccf62d5ed0827b8072de2de35034fde1bccc21cc (diff) | |
download | erlang-9657eb547df68112ffb901baade6cb9b22379445.tar.gz |
Fix tests for inet_backend = socket
-rw-r--r-- | lib/kernel/test/gen_tcp_misc_SUITE.erl | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index 40dbeddccd..9f23ca5992 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -6459,7 +6459,7 @@ otp_12242(Config, Addr) when (tuple_size(Addr) =:= 4) -> ?P("close order received - close accepted socket"), ok = gen_tcp:close(A) end - end, [monitor]), + end, [link, monitor]), ?P("await listen port"), LPort = receive {Listener,port,P} -> P end, ?P("try connect to ~w", [LPort]), @@ -6481,12 +6481,25 @@ otp_12242(Config, Addr) when (tuple_size(Addr) =:= 4) -> ok. -otp_12242_2(C, Blob, Datasize) when is_port(C) -> +otp_12242_2(C, Blob, Datasize) -> %% Fill the buffers ?P("sending ~p bytes", [Datasize]), - ok = gen_tcp:send(C, Blob), - ?P("sent ~p bytes", [Datasize]), + case gen_tcp:send(C, Blob) of + ok -> + ?P("sent ~p bytes", [Datasize]), + otp_12242_3(C, Blob, Datasize); + {error, {timeout, _RestData}} -> + %% We filled the buffers and timed out; + %% this is probably the socket backend - give up. + ok; + {error, timeout} -> + %% The same as the previous clause + ok + end, + _ = gen_tcp:close(C), + ok. +otp_12242_3(C, Blob, Datasize) -> %% Try to ensure that the close call is in progress %% before the owner proceeds with sending CloserMRef = otp_12242_closer(C), |