Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

rebar_eunit:reset_after_eunit/1 mustn't remove 'included_applications' #47

Merged
merged 1 commit into from

2 participants

@uwiger

One could argue that rebar_eunit does some pretty dangerous stuff when
trying to clean up after a test run, but specifically, it tells the
Application Controller to delete everything returned by
application:get_all_env(App). Unfortunately, included_applications
also goes, which can lead to a crash in application_controller, if
the application is subsequently unloaded.

This patch attempts the smallest possible fix: remove all env
variables except included_applications.

@uwiger uwiger rebar_eunit:reset_after_eunit/1 mustn't remove 'included_applications'
One could argue that rebar_eunit does some pretty dangerous stuff when
trying to clean up after a test run, but specifically, it tells the
Application Controller to delete everything returned by
application:get_all_env(App). Unfortunately, included_applications
also goes, which can lead to a crash in application_controller, if
the application is subsequently unloaded.

This patch attempts the smallest possible fix: remove all env
variables except included_applications.
209ca73
@dizzyd dizzyd merged commit d3c125d into rebar:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 16, 2012
  1. @uwiger

    rebar_eunit:reset_after_eunit/1 mustn't remove 'included_applications'

    uwiger authored
    One could argue that rebar_eunit does some pretty dangerous stuff when
    trying to clean up after a test run, but specifically, it tells the
    Application Controller to delete everything returned by
    application:get_all_env(App). Unfortunately, included_applications
    also goes, which can lead to a crash in application_controller, if
    the application is subsequently unloaded.
    
    This patch attempts the smallest possible fix: remove all env
    variables except included_applications.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/rebar_eunit.erl
View
3  src/rebar_eunit.erl
@@ -629,7 +629,8 @@ reset_after_eunit({OldProcesses, WasAlive, OldAppEnvs, _OldACs}) ->
end,
ok = application:unset_env(App, K)
end || App <- Apps, App /= rebar,
- {K, _V} <- application:get_all_env(App)],
+ {K, _V} <- application:get_all_env(App),
+ K =/= included_applications],
reconstruct_app_env_vars(Apps),
Something went wrong with that request. Please try again.