anchor.diff:  
       session_teardown(Worker1, SessId2),
       session_teardown(Worker2, SessId1),
  +
  +    ok.
  +
  +event_stream_crash_test(Config) ->
  +    [Worker | _] = ?config(op_worker_nodes, Config),
  +    SessId = ?config(session_id, Config),
  +    Self = self(),
  +    EvtsCount = 100,
  +    HalfEvts = round(EvtsCount / 2),
  +
  +    {ok, SubId} = subscribe(Worker,
  +        gui,
  +        fun(#write_event{}) -> true; (_) -> false end,
  +        fun(Meta) -> Meta >= EvtsCount end,
  +        [fun(Evts) -> Self ! {handler, Evts} end]
  +    ),
  +
  +    % Emit first part of 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, HalfEvts - 1)),
  +
  +    % Get event stream pid.
  +    {ok, {SessSup, _}} = rpc:call(Worker, session,
  +        get_session_supervisor_and_node, [SessId]),
  +    {ok, EvtManSup} = get_child(SessSup, event_manager_sup),
  +    {ok, EvtStmSup} = get_child(EvtManSup, event_stream_sup),
  +    {ok, EvtStm} = get_child(EvtStmSup, undefined),
  +
  +    % Send crash message and wait for event stream recovery.
  +    gen_server:cast(EvtStm, kill),
  +    timer:sleep(?TIMEOUT),
  +
  +    % Emit second part of 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(HalfEvts, 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)),
  +    ?assertEqual({error, timeout}, test_utils:receive_any()),
  +
  +    unsubscribe(Worker, SubId),
   
       ok.
   
  
positive.code:     end),
      Config;
  
  init_per_testcase(event_manager_test, Config) ->
      [Worker | _] = ?config(op_worker_nodes, Config),
      Self = self(),
  
negative.code: -spec unsubscribe(Worker :: node(), SubId :: event_manager:subscription_id()) ->
      ok.
  unsubscribe(Worker, SubId) ->
      ?assertEqual(ok, rpc:call(Worker, event_manager, unsubscribe, [SubId])).
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Returns supervisor child.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_child(Sup :: pid(), ChildId :: term()) ->
      {ok, Child :: pid()} | {error, not_found}.
  get_child(Sup, ChildId) ->
      Children = supervisor:which_children(Sup),
      case lists:keyfind(ChildId, 1, Children) of
          {ChildId, Child, _, _} -> {ok, Child};
          false -> {error, not_found}
      end.