Expected=lists:flatten(io_lib:format("[error] ~w CRASH REPORT Process ~w with 0 neighbours crashed with reason: maximum number of file descriptors exhausted, check ulimit -n",[self(),self()])),
Expected=lists:flatten(io_lib:format("[error] ~w CRASH REPORT Process ~w with 0 neighbours crashed with reason: system limit: maximum number of processes exceeded",[self(),self()])),
Expected=lists:flatten(io_lib:format("[error] ~w CRASH REPORT Process ~w with 0 neighbours crashed with reason: system limit: maximum number of processes exceeded",[self(),self()])),
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()])),
Expected=lists:flatten(io_lib:format("[error] ~w CRASH REPORT Process ~w with 0 neighbours crashed with reason: system limit: tried to create an atom larger than 255, or maximum atom count exceeded",[self(),self()])),
Expected=lists:flatten(io_lib:format("[error] ~w CRASH REPORT Process ~w with 0 neighbours crashed with reason: system limit: maximum number of ETS tables exceeded",[self(),test])),
{"crash reports for 'special processes' should be handled right - case_clause",
fun()->
{ok,Pid}=special_process:start(),
unlink(Pid),
Pid!{case_clause,wtf},
timer:sleep(500),
_=gen_event:which_handlers(error_logger),
{_,_,Msg}=pop(),
Expected=lists:flatten(io_lib:format("[error] ~p CRASH REPORT Process ~p with 0 neighbours crashed with reason: no case clause matching wtf in special_process:loop/0",
[Pid,Pid])),
test_body(Expected,lists:flatten(Msg))
end
},
{"crash reports for 'special processes' should be handled right - exit",
fun()->
{ok,Pid}=special_process:start(),
unlink(Pid),
Pid!exit,
timer:sleep(500),
_=gen_event:which_handlers(error_logger),
{_,_,Msg}=pop(),
Expected=lists:flatten(io_lib:format("[error] ~p CRASH REPORT Process ~p with 0 neighbours exited with reason: byebye in special_process:loop/0",
[Pid,Pid])),
test_body(Expected,lists:flatten(Msg))
end
},
{"crash reports for 'special processes' should be handled right - error",
fun()->
{ok,Pid}=special_process:start(),
unlink(Pid),
Pid!error,
timer:sleep(500),
_=gen_event:which_handlers(error_logger),
{_,_,Msg}=pop(),
Expected=lists:flatten(io_lib:format("[error] ~p CRASH REPORT Process ~p with 0 neighbours crashed with reason: mybad in special_process:loop/0",
[Pid,Pid])),
test_body(Expected,lists:flatten(Msg))
end
},
{"messages should not be generated if they don't satisfy the threshold",