|
@@ -155,6 +155,35 @@ pooler_basics_dynamic_test_() ->
|
|
|
end,
|
|
|
basic_tests()}}.
|
|
|
|
|
|
+pooler_basics_integration_to_other_supervisor_test_() ->
|
|
|
+ {setup,
|
|
|
+ fun() ->
|
|
|
+ application:set_env(pooler, metrics_module, fake_metrics),
|
|
|
+ fake_metrics:start_link()
|
|
|
+ end,
|
|
|
+ fun(_X) ->
|
|
|
+ fake_metrics:stop()
|
|
|
+ end,
|
|
|
+ {foreach,
|
|
|
+ % setup
|
|
|
+ fun() ->
|
|
|
+ Pool = [{name, test_pool_1},
|
|
|
+ {max_count, 3},
|
|
|
+ {init_count, 2},
|
|
|
+ {start_mfa,
|
|
|
+ {pooled_gs, start_link, [{"type-0"}]}}],
|
|
|
+ application:unset_env(pooler, pools),
|
|
|
+ error_logger:delete_report_handler(error_logger_tty_h),
|
|
|
+ application:start(pooler),
|
|
|
+ supervisor:start_link(fake_external_supervisor, Pool)
|
|
|
+ end,
|
|
|
+ fun({ok, SupPid}) ->
|
|
|
+ exit(SupPid, normal),
|
|
|
+ application:stop(pooler)
|
|
|
+ end,
|
|
|
+ basic_tests()}}.
|
|
|
+
|
|
|
+
|
|
|
basic_tests() ->
|
|
|
[
|
|
|
{"there are init_count members at start",
|