Browse Source

fix(cth-suite): use cheaper check for loaded applications

Andrew Mayorov 2 years ago
parent
commit
8f2a4f7b19
1 changed files with 1 additions and 2 deletions
  1. 1 2
      apps/emqx/test/emqx_cth_suite.erl

+ 1 - 2
apps/emqx/test/emqx_cth_suite.erl

@@ -177,10 +177,9 @@ load_appspec({App, _Opts}) ->
     load_app_deps(App).
     load_app_deps(App).
 
 
 load_app_deps(App) ->
 load_app_deps(App) ->
-    AlreadyLoaded = [A || {A, _, _} <- application:loaded_applications()],
     case application:get_key(App, applications) of
     case application:get_key(App, applications) of
         {ok, Deps} ->
         {ok, Deps} ->
-            Apps = Deps -- AlreadyLoaded,
+            Apps = [D || D <- Deps, application:get_key(D, id) == undefined],
             ok = lists:foreach(fun emqx_common_test_helpers:load/1, Apps),
             ok = lists:foreach(fun emqx_common_test_helpers:load/1, Apps),
             ok = lists:foreach(fun load_app_deps/1, Apps);
             ok = lists:foreach(fun load_app_deps/1, Apps);
         undefined ->
         undefined ->