Stop applications before killing extra processes

This means that applications get a chance to shut down themselves,
before rebar will start killing their processes.  This avoids ERROR
REPORTS from application supervisors.
This commit is contained in:
Klas Johansson 2011-10-31 23:11:50 +01:00 committed by Tuncer Ayaz
parent b10224be62
commit 896e8505b2

View file

@ -484,9 +484,6 @@ reset_after_eunit({OldProcesses, WasAlive, OldAppEnvs, _OldACs}) ->
ok
end,
Processes = erlang:processes(),
_ = kill_extras(Processes -- OldProcesses),
OldApps = [App || {App, _} <- OldAppEnvs],
Apps = get_app_names(),
_ = [begin
@ -499,6 +496,10 @@ reset_after_eunit({OldProcesses, WasAlive, OldAppEnvs, _OldACs}) ->
{K, _V} <- application:get_all_env(App)],
reconstruct_app_env_vars(Apps),
Processes = erlang:processes(),
_ = kill_extras(Processes -- OldProcesses),
ok.
kill_extras(Pids) ->