anchor.diff:      %% The buffer was resized
       wait_for_mocked_call(logplex_drain_buffer, resize_msg_buffer, ['_',Val], 1, 1000).
   
  +close_max_ttl(Config) ->
  +    ChannelId = ?config(channel, Config),
  +    Client = ?config(client, Config),
  +    client_call_status(Client, 200),
  +    logplex_channel:post_msg({channel, ChannelId}, fake_msg("mymsg1")),
  +    wait_for_mocked_call(logplex_http_client, raw_request, '_', 1, 50),
  +    timer:sleep(40),
  +    logplex_channel:post_msg({channel, ChannelId}, fake_msg("mymsg2")),
  +    wait_for_mocked_call(logplex_http_client, raw_request, '_', 2, 50),
  +    timer:sleep(40),
  +    Hist = meck:history(logplex_http_client),
  +    [First, Second] =
  +      [iolist_to_binary(IoData) ||
  +       {_Pid, {_Mod, raw_request, [_Ref, IoData, _TimeOut]}, _Res} <- Hist],
  +    %% ensure idle drain is closed
  +    wait_for_mocked_call(logplex_http_client, close, '_', 1, 20),
  +    {match, _} = re:run(First, "mymsg1"),
  +    {match, _} = re:run(Second, "mymsg2").
  +
   %%% HELPERS
   wait_for_mocked_call(Mod, Fun, Args, NumCalls, Time) ->
       wait_for_mocked_call(Mod,Fun,Args, NumCalls, Time*1000,os:timestamp()).
  
positive.code:          {"LOGPLEX_AUTH_KEY", uuid:to_string(uuid:v4())},
           {"LOGPLEX_COOKIE", "ct test"},
           {"LOGPLEX_HTTP_DRAIN_IDLE", "50"},
           {"LOGPLEX_HTTP_IDLE_FUZZ", "1"}
          ]].
  
  
  
negative.code:         1000 ->
              erlang:exit("process took more than 1s to exit")
      end.
  
  fake_msg(M) ->
      {user, debug, logplex_syslog_utils:datetime(now), "fakehost", "erlang", M}.
  