Skip to content

Commit

Permalink
observer: Improve debugging code in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
sirihansen committed Sep 18, 2017
1 parent 3a2a22e commit de4e620
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/observer/test/observer_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ basic(doc) -> [""];
basic(Config) when is_list(Config) ->
timer:send_after(100, "foobar"), %% Otherwise the timer server gets added to procs
ProcsBefore = processes(),
ProcInfoBefore = [{P,process_info(P)} || P <- ProcsBefore],
NumProcsBefore = length(ProcsBefore),

ok = observer:start(),
Expand Down Expand Up @@ -145,8 +146,10 @@ basic(Config) when is_list(Config) ->
ProcsAfter = processes(),
NumProcsAfter = length(ProcsAfter),
if NumProcsAfter=/=NumProcsBefore ->
BeforeNotAfter = ProcsBefore -- ProcsAfter,
ct:log("Before but not after:~n~p~n",
[[{P,process_info(P)} || P <- ProcsBefore -- ProcsAfter]]),
[[{P,I} || {P,I} <- ProcInfoBefore,
lists:member(P,BeforeNotAfter)]]),
ct:log("After but not before:~n~p~n",
[[{P,process_info(P)} || P <- ProcsAfter -- ProcsBefore]]),
ct:fail("leaking processes");
Expand Down

0 comments on commit de4e620

Please sign in to comment.