Error report killing inet_gethost_native after eunit#168
Merged
dizzyd merged 1 commit intobasho:masterfrom Dec 30, 2011
tomas-abrahamsson:eunit-inet_gethost_native
Merged
Error report killing inet_gethost_native after eunit#168dizzyd merged 1 commit intobasho:masterfrom tomas-abrahamsson:eunit-inet_gethost_native
dizzyd merged 1 commit intobasho:masterfrom
tomas-abrahamsson:eunit-inet_gethost_native
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 == ** killedThe following test case is sufficient to provoke the printout above:
x_test() -> {ok, _Hostent} = inet:gethostbyname(localhost).BRs
Tomas