Skip to content

Comments

Error report killing inet_gethost_native after eunit#168

Merged
dizzyd merged 1 commit intobasho:masterfrom
tomas-abrahamsson:eunit-inet_gethost_native
Dec 30, 2011
Merged

Error report killing inet_gethost_native after eunit#168
dizzyd merged 1 commit intobasho:masterfrom
tomas-abrahamsson:eunit-inet_gethost_native

Conversation

@tomas-abrahamsson
Copy link
Contributor

This is a change to not kill the inet_gethost_native process. That process is started on demand to do name lookups, so it might well happen that it is started by an eunit test case. If so, the cleanup after eunit will kill it, producing printouts 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

The following test case is sufficient to provoke the printout above:

  x_test() ->
      {ok, _Hostent} = inet:gethostbyname(localhost).

BRs
Tomas

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.
dizzyd added a commit that referenced this pull request Dec 30, 2011
Error report killing inet_gethost_native after eunit
@dizzyd dizzyd merged commit 9872873 into basho:master Dec 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants