anchor.diff:              {"crash report for system port limit",
                   fun() ->
                           error_logger:error_report(crash_report, [[{pid, self()}, {error_info, {error, {system_limit, [{erlang, open_port, 1}]}, []}}], []]),
  -                        _ = gen_event:which_handlers(error_logger),
  -                        timer:sleep(100),
  +                        custom_sleep(100),
                           {_, _, Msg} = pop(),
                           Expected = lists:flatten(io_lib:format("[error] ~w CRASH REPORT Process ~w with 0 neighbours crashed with reason: system limit: maximum number of ports exceeded", [self(), self()])),
                           ?assertEqual(Expected, lists:flatten(Msg))
  
positive.code:             {"supervisor reports",
                  fun() ->
                          error_logger:error_report(supervisor_report, [{errorContext, france}, {offender, [{name, mini_steve}, {mfargs, {a, b, [c]}}, {pid, bleh}]}, {reason, fired}, {supervisor, {local, steve}}]),
                          _ = gen_event:which_handlers(error_logger),
                          timer:sleep(100),
                          {_, _, Msg} = pop(),
                          Expected = lists:flatten(io_lib:format("[error] ~w Supervisor steve had child mini_steve started with a:b(c) at bleh exit with reason fired in context france", [self()])),
                          ?assertEqual(Expected, lists:flatten(Msg))
  
negative.code:             {"info messages are truncated at 4096 characters",
                  fun() ->
                          error_logger:info_msg("doom, doom has come upon you all ~p", [string:copies("doom", 10000)]),
                          custom_sleep(1000),
                          {_, _, Msg} = pop(),
                          ?assert(length(lists:flatten(Msg)) < 5100)
                  end
  