anchor.diff:  
       ok.
   
  +%% Test periodic emission of aggregated events.
  +event_stream_periodic_emission_test(Config) ->
  +    [Worker | _] = ?config(op_worker_nodes, Config),
  +    SessId = ?config(session_id, Config),
  +    Self = self(),
  +    EmTime = timer:seconds(2),
  +    EvtsCount = 100,
  +
  +    {ok, SubId} = subscribe(Worker,
  +        gui,
  +        EmTime,
  +        fun(#write_event{}) -> true; (_) -> false end,
  +        fun(_) -> false end,
  +        [fun(Evts) -> Self ! {handler, Evts} end]
  +    ),
  +
  +    % Emit events.
  +    lists:foreach(fun(N) ->
  +        emit(Worker, #write_event{size = 1, counter = 1, file_size = N + 1,
  +            blocks = [#file_block{offset = N, size = 1}]}, SessId)
  +    end, lists:seq(0, EvtsCount - 1)),
  +
  +    % Check whether event handlers have been executed.
  +    ?assertMatch({ok, _}, test_utils:receive_msg({handler, [#write_event{
  +        size = EvtsCount, counter = EvtsCount, file_size = EvtsCount,
  +        blocks = [#file_block{offset = 0, size = EvtsCount}]}]}, ?TIMEOUT + EmTime)),
  +    ?assertEqual({error, timeout}, test_utils:receive_any(EmTime)),
  +
  +    unsubscribe(Worker, SubId),
  +
  +    ok.
  +
  +%% Test event stream reinitialization in case of crash.
   event_stream_crash_test(Config) ->
       [Worker | _] = ?config(op_worker_nodes, Config),
       SessId = ?config(session_id, Config),
       Self = self(),
       EvtsCount = 100,
  -    HalfEvts = round(EvtsCount / 2),
  +    HalfEvtsCount = round(EvtsCount / 2),
   
       {ok, SubId} = subscribe(Worker,
           gui,
  
positive.code: %% tests
  -export([
      event_stream_test/1,
      event_stream_crash_test/1,
      event_manager_test/1
  ]).
  
  all() -> [
      event_stream_test,
      event_stream_crash_test,
      event_manager_test
  ].
  
negative.code:     lists:foreach(fun(N) ->
          emit(Worker, #write_event{size = 1, counter = 1, file_size = N + 1,
              blocks = [#file_block{offset = N, size = 1}]}, SessId)
      end, lists:seq(0, HalfEvtsCount - 1)),
  
      % Get event stream pid.
      {ok, {SessSup, _}} = rpc:call(Worker, session,
  