summaryrefslogtreecommitdiff
path: root/src/rebar_eunit.erl
diff options
context:
space:
mode:
authorScott Lystig Fritchie <slfritchie@snookles.com>2011-08-24 12:11:48 -0500
committerScott Lystig Fritchie <slfritchie@snookles.com>2011-08-24 12:11:48 -0500
commit9c8b5e6c82fc055dd13a8d0a056add7658cbc3e2 (patch)
treed8490531efb9bf26693d393d190bcd15cf976b85 /src/rebar_eunit.erl
parent0627075dd69cb22a1f74e4eb698afc0b5abf784d (diff)
Check $ancestors for kernel OTP app processes to not kill
Diffstat (limited to 'src/rebar_eunit.erl')
-rw-r--r--src/rebar_eunit.erl31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index 99de632..96f1978 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -499,20 +499,33 @@ kill_extras(Pids) ->
%% 1. Interfere with stuff that we don't want interfered with, or
%% 2. May/will force the 'kernel' app to shutdown, which *will*
%% interfere with rebar's ability To Do Useful Stuff(tm).
- KeepProcs = [cover_server, eunit_server, inet_gethost_native_sup,
- inet_gethost_native, timer_server],
+ %% This list may require changes as OTP versions and/or
+ %% rebar use cases change.
+ KeepProcs = [cover_server, eunit_server,
+ eqc, eqc_license, eqc_locked],
Killed = [begin
Info = case erlang:process_info(Pid) of
undefined -> [];
Else -> Else
end,
- Keep = case proplists:get_value(registered_name, Info) of
- undefined ->
- false;
- Name ->
- lists:member(Name, KeepProcs)
- end,
- if Keep ->
+ Keep1 = case proplists:get_value(registered_name, Info) of
+ undefined ->
+ false;
+ Name ->
+ lists:member(Name, KeepProcs)
+ end,
+ Keep2 = case proplists:get_value(dictionary, Info) of
+ undefined ->
+ false;
+ Ds ->
+ case proplists:get_value('$ancestors', Ds) of
+ undefined ->
+ false;
+ As ->
+ lists:member(kernel_sup, As)
+ end
+ end,
+ if Keep1 orelse Keep2 ->
ok;
true ->
?DEBUG("Kill ~p ~p\n", [Pid, Info]),