aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2018-07-18 14:19:24 +0200
committerErlang/OTP <[email protected]>2018-07-18 14:19:24 +0200
commit85ca97e20c1ada4fb67e83262732c7e4ec03a15b (patch)
tree99f8462348f2c2a9fb6dbbee663b44e3f1e7b7b1 /erts/emulator/test
parent5779b53086acccbf9b1dd6001bba018d47dd743c (diff)
parent095c832e1d644c85e452527ffae43dce34b5075e (diff)
downloadotp-85ca97e20c1ada4fb67e83262732c7e4ec03a15b.tar.gz
otp-85ca97e20c1ada4fb67e83262732c7e4ec03a15b.tar.bz2
otp-85ca97e20c1ada4fb67e83262732c7e4ec03a15b.zip
Merge branch 'john/erts/kqueue-stdin-polling/OTP-15169/ERL-647' into maint-21
* john/erts/kqueue-stdin-polling/OTP-15169/ERL-647: Use fallback pollset for stdin and friends when using kqueue
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/driver_SUITE.erl24
1 files changed, 24 insertions, 0 deletions
diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl
index 7aff3a6ea1..6f5d639d04 100644
--- a/erts/emulator/test/driver_SUITE.erl
+++ b/erts/emulator/test/driver_SUITE.erl
@@ -81,6 +81,7 @@
thr_msg_blast/1,
consume_timeslice/1,
env/1,
+ poll_pipe/1,
z_test/1]).
-export([bin_prefix/2]).
@@ -168,6 +169,7 @@ all() -> %% Keep a_test first and z_test last...
thr_msg_blast,
consume_timeslice,
env,
+ poll_pipe,
z_test].
groups() ->
@@ -2693,3 +2695,25 @@ rpc(Config, Fun) ->
ct:fail(Other)
end
end.
+
+poll_pipe(Config) when is_list(Config) ->
+ %% ERL-647; we wouldn't see any events on EOF when polling a pipe using
+ %% kqueue(2).
+ case os:type() of
+ {unix, _} ->
+ Command = "erl -noshell -eval "
+ "'\"DATA\n\" = io:get_line(\"\"),"
+ "eof = io:get_line(\"\"),"
+ "halt()' <<< 'DATA'",
+ Ref = make_ref(),
+ Self = self(),
+ Pid = spawn(fun() -> os:cmd(Command), Self ! Ref end),
+ receive
+ Ref -> ok
+ after 5000 ->
+ exit(Pid, kill),
+ ct:fail("Stuck reading from stdin.")
+ end;
+ _ ->
+ {skipped, "Unix-only test"}
+ end.