Рефакторинг обработчиков. Финальное тестирование #21
This commit is contained in:
@@ -53,6 +53,13 @@ init_per_suite(Config) ->
|
||||
case os:getenv("CT_MODE", "local") of
|
||||
"remote" ->
|
||||
ct:pal("Remote mode: assuming application is already running"),
|
||||
inets:start(),
|
||||
ssl:start(),
|
||||
% Отключаем авто-редирект и проверку сертификатов
|
||||
httpc:set_options([
|
||||
{autoredirect, false},
|
||||
{ssl, [{verify, verify_none}]}
|
||||
]),
|
||||
wait_for_remote(),
|
||||
[{started_by_us, false} | Config];
|
||||
_ ->
|
||||
@@ -163,7 +170,7 @@ wait_for_remote() ->
|
||||
wait_for_health(_URL, 0) ->
|
||||
ct:fail("Remote API did not start within 30 seconds");
|
||||
wait_for_health(URL, Retries) ->
|
||||
case httpc:request(get, {URL, []}, [], []) of
|
||||
case httpc:request(get, {URL, []}, [{timeout, 5000}, {ssl, [{verify, verify_none}]}], []) of
|
||||
{ok, {{_, 200, _}, _, _}} -> ok;
|
||||
_ ->
|
||||
timer:sleep(1000),
|
||||
|
||||
Reference in New Issue
Block a user