Ver código fonte

Reduce amount of backend spawns

pull/346/head
Mark Allen 9 anos atrás
pai
commit
2f9ce2513d
1 arquivos alterados com 5 adições e 2 exclusões
  1. +5
    -2
      test/lager_test_backend.erl

+ 5
- 2
test/lager_test_backend.erl Ver arquivo

@ -1570,7 +1570,8 @@ async_threshold_test_() ->
?assertEqual(true, lager_config:get(async)), ?assertEqual(true, lager_config:get(async)),
%% put a ton of things in the queue %% put a ton of things in the queue
Workers = [spawn_monitor(fun() -> [lager:info("hello world") || _ <- lists:seq(1, 1000)] end) || _ <- lists:seq(1, 15)],
Workers = [spawn_monitor(fun() -> [lager:info("hello world") || _ <- lists:seq(1, 100)] end)
|| _ <- lists:seq(1, 10)],
%% serialize on mailbox %% serialize on mailbox
_ = gen_event:which_handlers(lager_event), _ = gen_event:which_handlers(lager_event),
@ -1588,7 +1589,9 @@ async_threshold_test_() ->
%% point in the past %% point in the past
?assertMatch([{sync_toggled, N}] when N > 0, ?assertMatch([{sync_toggled, N}] when N > 0,
ets:lookup(async_threshold_test, sync_toggled)), ets:lookup(async_threshold_test, sync_toggled)),
%% wait for all the workers to return, meaning that all the messages have been logged (since we're definitely in sync mode at the end of the run)
%% wait for all the workers to return, meaning that all
%% the messages have been logged (since we're
%% definitely in sync mode at the end of the run)
collect_workers(Workers), collect_workers(Workers),
%% serialize on the mailbox again %% serialize on the mailbox again
_ = gen_event:which_handlers(lager_event), _ = gen_event:which_handlers(lager_event),

Carregando…
Cancelar
Salvar