summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Abrahamsson <tomas.abrahamsson@gmail.com>2011-12-29 23:38:03 +0100
committerTomas Abrahamsson <tomas.abrahamsson@gmail.com>2011-12-29 23:38:03 +0100
commitc8f56c7cb239f267a12e86afdfc4b87c9052eba7 (patch)
tree91ff72d35d82ec13d61206eeffaf1e939947debc
parentf47d61bc13d4b93c2dc234ceebf27d2d3a18507f (diff)
Don't kill any inet_gethost_native after eunit
Avoid error reports like this one: prompt$ rebar eunit ==> dummy (eunit) Test passed. =ERROR REPORT==== 29-Dec-2011::23:22:11 === ** Generic server inet_gethost_native_sup terminating ** Last message in was {'EXIT',<0.62.0>,killed} ** When Server state == {state,inet_gethost_native,undefined,<0.62.0>, {local,inet_gethost_native_sup}} ** Reason for termination == ** killed Previously, it could happen if an eunit test did something that required a name lookup, like in this example: -module(dummy_tests). -include_lib("eunit/include/eunit.hrl"). x_test() -> {ok, _Hostent} = inet:gethostbyname(localhost). The inet_gethost_native is a process, started on demand, under a supervisor_bridge under the kernel_sup, but it is not a gen_server process or the like, so it has nothing in '$ancestors' in its process dictionary to indicate it is part of kernel.
-rw-r--r--src/rebar_eunit.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index 2b887ee..2743b0e 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -477,7 +477,11 @@ kill_extras(Pids) ->
%% This list may require changes as OTP versions and/or
%% rebar use cases change.
KeepProcs = [cover_server, eunit_server,
- eqc, eqc_license, eqc_locked],
+ eqc, eqc_license, eqc_locked,
+ %% inet_gethost_native is started on demand, when
+ %% doing name lookups. It is under kernel_sup, under
+ %% a supervisor_bridge.
+ inet_gethost_native],
Killed = [begin
Info = case erlang:process_info(Pid) of
undefined -> [];