aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-06-13 10:09:31 +0200
committerBjörn Gustavsson <[email protected]>2017-06-13 12:25:14 +0200
commit66bfe2f5d977bdac5809a273bd7b30f42063548f (patch)
tree0afc9266a24244e85303f0ae054bf7018e1bb728
parent23e3855559445500f109798373312830d6e746f1 (diff)
downloadotp-66bfe2f5d977bdac5809a273bd7b30f42063548f.tar.gz
otp-66bfe2f5d977bdac5809a273bd7b30f42063548f.tar.bz2
otp-66bfe2f5d977bdac5809a273bd7b30f42063548f.zip
trace_nif_SUITE: Don't leave processes running
-rw-r--r--erts/emulator/test/trace_nif_SUITE.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl
index 7ac6fce234..5c35a8a83f 100644
--- a/erts/emulator/test/trace_nif_SUITE.erl
+++ b/erts/emulator/test/trace_nif_SUITE.erl
@@ -80,7 +80,7 @@ trace_nif_meta(Config) when is_list(Config) ->
{?MODULE,nif, ["Arg1"]}}),
ok.
do_trace_nif(Flags) ->
- Pid = spawn(?MODULE, nif_process, []),
+ Pid = spawn_link(?MODULE, nif_process, []),
1 = erlang:trace(Pid, true, [call]),
erlang:trace_pattern({?MODULE,nif,'_'}, [], Flags),
Pid ! {apply_nif, nif, []},
@@ -123,6 +123,8 @@ do_trace_nif(Flags) ->
1 = erlang:trace(Pid, false, [call]),
erlang:trace_pattern({?MODULE,nif,'_'}, false, Flags),
+
+ unlink(Pid),
exit(Pid, die),
ok.
@@ -137,7 +139,7 @@ trace_nif_timestamp_local(Config) when is_list(Config) ->
do_trace_nif_timestamp([local]).
do_trace_nif_timestamp(Flags) ->
- Pid=spawn(?MODULE, nif_process, []),
+ Pid = spawn_link(?MODULE, nif_process, []),
1 = erlang:trace(Pid, true, [call,timestamp]),
erlang:trace_pattern({?MODULE,nif,'_'}, [], Flags),
@@ -170,6 +172,7 @@ do_trace_nif_timestamp(Flags) ->
1 = erlang:trace(Pid, false, [call]),
erlang:trace_pattern({erlang,'_','_'}, false, Flags),
+ unlink(Pid),
exit(Pid, die),
ok.
@@ -177,7 +180,7 @@ do_trace_nif_timestamp(Flags) ->
trace_nif_return(Config) when is_list(Config) ->
load_nif(Config),
- Pid=spawn(?MODULE, nif_process, []),
+ Pid = spawn_link(?MODULE, nif_process, []),
1 = erlang:trace(Pid, true, [call,timestamp,return_to]),
erlang:trace_pattern({?MODULE,nif,'_'}, [{'_',[],[{return_trace}]}],
[local]),