ソースを参照

Only sleep for a long time when CI env variable is present, like on Travis CI

pull/509/head
Luke Bakken 5年前
コミット
aa09a2cd9c
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: D99DE30E43EAE440
1個のファイルの変更13行の追加3行の削除
  1. +13
    -3
      test/lager_test_backend.erl

+ 13
- 3
test/lager_test_backend.erl ファイルの表示

@ -1776,6 +1776,8 @@ async_threshold_test_() ->
{foreach, Setup, Cleanup, [ {foreach, Setup, Cleanup, [
{"async threshold works", {"async threshold works",
{timeout, 30, fun() -> {timeout, 30, fun() ->
Sleep = get_long_sleep_value(),
%% we start out async %% we start out async
?assertEqual(true, lager_config:get(async)), ?assertEqual(true, lager_config:get(async)),
?assertEqual([{sync_toggled, 0}], ?assertEqual([{sync_toggled, 0}],
@ -1790,7 +1792,7 @@ async_threshold_test_() ->
%% serialize on mailbox %% serialize on mailbox
_ = gen_event:which_handlers(lager_event), _ = gen_event:which_handlers(lager_event),
timer:sleep(5000),
timer:sleep(Sleep),
%% By now the flood of messages should have forced the backend throttle %% By now the flood of messages should have forced the backend throttle
%% to turn off async mode, but it's possible all outstanding requests %% to turn off async mode, but it's possible all outstanding requests
@ -1807,12 +1809,12 @@ async_threshold_test_() ->
%% serialize on the mailbox again %% serialize on the mailbox again
_ = gen_event:which_handlers(lager_event), _ = gen_event:which_handlers(lager_event),
timer:sleep(5000),
timer:sleep(Sleep),
lager:info("hello world"), lager:info("hello world"),
_ = gen_event:which_handlers(lager_event), _ = gen_event:which_handlers(lager_event),
timer:sleep(5000),
timer:sleep(Sleep),
%% async is true again now that the mailbox has drained %% async is true again now that the mailbox has drained
?assertEqual(true, lager_config:get(async)), ?assertEqual(true, lager_config:get(async)),
@ -1904,4 +1906,12 @@ high_watermark_test_() ->
] ]
}. }.
get_long_sleep_value() ->
case os:getenv("CI") of
false ->
500;
_ ->
5000
end.
-endif. -endif.

読み込み中…
キャンセル
保存