aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/monitor_SUITE.erl
diff options
context:
space:
mode:
authorDmytro Lytovchenko <[email protected]>2016-05-25 14:37:03 +0200
committerLukas Larsson <[email protected]>2016-06-10 09:46:33 +0200
commit3ee5343415d6ae0ce1ff1c2a2555051431a9315e (patch)
tree50f0acc46c6f30bf9ce58b9851ca1a2cd92f1772 /erts/emulator/test/monitor_SUITE.erl
parentd26c15e07229c90ba8353bd78d5406ada0f13271 (diff)
downloadotp-3ee5343415d6ae0ce1ff1c2a2555051431a9315e.tar.gz
otp-3ee5343415d6ae0ce1ff1c2a2555051431a9315e.tar.bz2
otp-3ee5343415d6ae0ce1ff1c2a2555051431a9315e.zip
erts: Add port monitors
* erlang:monitor/2 with port argument is added, erlang:demonitor, using port task API and avoiding locking; * port_info and process_info support for monitored ports (with named port monitors support); * Exit signals contain type 'process' or 'port'; * Propagation of port exit signals; * Self-cleaning when origin process dies with monitor on; * 8 test cases + testcase for port driver crashing; * Documentation for all of the above (monitor, demonitor, port_info and process_info) updated
Diffstat (limited to 'erts/emulator/test/monitor_SUITE.erl')
-rw-r--r--erts/emulator/test/monitor_SUITE.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl
index 8955e62df5..90d2bd8c5d 100644
--- a/erts/emulator/test/monitor_SUITE.erl
+++ b/erts/emulator/test/monitor_SUITE.erl
@@ -21,6 +21,7 @@
-module(monitor_SUITE).
-include_lib("common_test/include/ct.hrl").
+-include_lib("eunit/include/eunit.hrl").
-export([all/0, suite/0, groups/0,
case_1/1, case_1a/1, case_2/1, case_2a/1, mon_e_1/1, demon_e_1/1, demon_1/1,
@@ -706,7 +707,7 @@ named_down(Config) when is_list(Config) ->
spawn_opt(fun () ->
WFun = fun
(F, hej) -> F(F, hopp);
-(F, hopp) -> F(F, hej)
+ (F, hopp) -> F(F, hej)
end,
NoSchedulers = erlang:system_info(schedulers_online),
lists:foreach(fun (_) ->
@@ -726,13 +727,14 @@ named_down(Config) when is_list(Config) ->
NamedProc = spawn_link(fun () ->
receive after infinity -> ok end
end),
- true = register(Name, NamedProc),
+ ?assertEqual(true, register(Name, NamedProc)),
unlink(NamedProc),
exit(NamedProc, bang),
Mon = erlang:monitor(process, Name),
- receive {'DOWN',Mon, _, _, _} -> ok end,
- true = register(Name, self()),
- true = unregister(Name),
+ receive {'DOWN',Mon, _, _, bang} -> ok
+ after 3000 -> ?assert(false) end,
+ ?assertEqual(true, register(Name, self())),
+ ?assertEqual(true, unregister(Name)),
process_flag(priority,Prio),
ok.