anchor.diff:      ?assertNotEqual(timeout, Resp),
       Resp.
   
  -wait_finished(_Consumer) ->
  -    Resp = receive
  +wait_finished({_, ConsumerRef}) ->
  +    receive
           {consumer_finished, Rows, LastSeq} ->
  -            {Rows, LastSeq}
  +            {Rows, LastSeq};
  +        {'DOWN', ConsumerRef, _, _, Msg} when Msg == normal; Msg == ok ->
  +            ok;
  +        {'DOWN', ConsumerRef, _, _, Msg} ->
  +            erlang:error({consumer_died, [
  +                {module, ?MODULE},
  +                {line, ?LINE},
  +                {value, Msg}
  +            ]})
       after ?TIMEOUT ->
  -        timeout
  -    end,
  -    ?assertNotEqual(timeout, Resp),
  -    Resp.
  +        erlang:error({consumer_died, [
  +            {module, ?MODULE},
  +            {line, ?LINE},
  +            {value, timeout}
  +        ]})
  +    end.
   
   spawn_consumer(DbName, ChangesArgs0, Req) ->
       Parent = self(),
  -    spawn(fun() ->
  +    spawn_monitor(fun() ->
           put(heartbeat_count, 0),
           Callback = fun
               ({change, {Change}, _}, _, Acc) ->
  
positive.code:     ?assertNotEqual(timeout, Resp),
      Resp.
  
  get_heartbeats(Consumer) ->
      Ref = make_ref(),
      Consumer ! {get_heartbeats, Ref},
      Resp = receive
  
negative.code:     ?assertNotEqual(timeout, Resp),
      Resp.
  
  stop_consumer({Consumer, _}) ->
      Ref = make_ref(),
      Consumer ! {stop, Ref},
      Resp = receive
  