From 896e8505b23d32dd9286e49f59a93959253c7b41 Mon Sep 17 00:00:00 2001 From: Klas Johansson Date: Mon, 31 Oct 2011 23:11:50 +0100 Subject: [PATCH] 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. --- src/rebar_eunit.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index 928f96b..439b8f9 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -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) ->