aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-16 14:58:40 +0200
committerMicael Karlberg <[email protected]>2019-05-29 14:22:47 +0200
commit22258359ff6633300ea6f28638eaae66deb0649a (patch)
treefb1cb2a798917ff0386f95449d6387c198a2d0e3 /erts
parentfaf4dc5c4e1724f1cd18c7242ceb4c8949f10260 (diff)
downloadotp-22258359ff6633300ea6f28638eaae66deb0649a.tar.gz
otp-22258359ff6633300ea6f28638eaae66deb0649a.tar.bz2
otp-22258359ff6633300ea6f28638eaae66deb0649a.zip
[socket] Add recvmsg(nowait) cancel on tcp test case
Add the recvmsg(nowait) cancel for tcp IPv4 test cases.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/test/socket_SUITE.erl29
1 files changed, 26 insertions, 3 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl
index 7f329ce9d2..f5757d5ce6 100644
--- a/erts/emulator/test/socket_SUITE.erl
+++ b/erts/emulator/test/socket_SUITE.erl
@@ -90,7 +90,7 @@
api_a_recvmsg_cancel_udp4/1,
api_a_accept_cancel_tcp4/1,
api_a_recv_cancel_tcp4/1,
- %% api_a_recvmsg_cancel_tcp4/1,
+ api_a_recvmsg_cancel_tcp4/1,
%% *** API Options ***
api_opt_simple_otp_options/1,
@@ -681,8 +681,8 @@ api_async_cases() ->
api_a_recvfrom_cancel_udp4,
api_a_recvmsg_cancel_udp4,
api_a_accept_cancel_tcp4,
- api_a_recv_cancel_tcp4%%,
- %% api_a_recvmsg_cancel_tcp4
+ api_a_recv_cancel_tcp4,
+ api_a_recvmsg_cancel_tcp4
].
api_options_cases() ->
@@ -4203,6 +4203,29 @@ api_a_recv_cancel_tcp4(_Config) when is_list(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Basically we make an async (Timeout = nowait) call to recvmsg,
+%% wait some time and then cancel.
+%%
+api_a_recvmsg_cancel_tcp4(suite) ->
+ [];
+api_a_recvmsg_cancel_tcp4(doc) ->
+ [];
+api_a_recvmsg_cancel_tcp4(_Config) when is_list(_Config) ->
+ ?TT(?SECS(10)),
+ tc_try(api_a_recvmsg_cancel_tcp4,
+ fun() ->
+ Recv = fun(Sock) ->
+ socket:recvmsg(Sock, nowait)
+ end,
+ InitState = #{domain => inet,
+ recv => Recv},
+ ok = api_a_recv_cancel_tcp(InitState)
+ end).
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
api_a_recv_cancel_tcp(InitState) ->
process_flag(trap_exit, true),
ServerSeq =