summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlas Johansson <klas.johansson@gmail.com>2011-10-31 23:11:50 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-11-02 20:08:24 +0100
commit896e8505b23d32dd9286e49f59a93959253c7b41 (patch)
tree657bbd9f2f0cc697ac4a5de22e764faabd2e6a55
parentb10224be6284a522b384f2319d00432629c1e7dc (diff)
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.
-rw-r--r--src/rebar_eunit.erl7
1 files 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) ->