aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2017-09-18 15:07:34 +0200
committerSiri Hansen <[email protected]>2017-09-18 15:07:34 +0200
commitde4e620a3fbd40e598d8f7da01258979246d0bd0 (patch)
tree258baa3947db900a66717cb50dae7b11deb6ed59 /lib/observer/test
parent3a2a22eaebdebe5bf46fa7aaea57532543c5039f (diff)
downloadotp-de4e620a3fbd40e598d8f7da01258979246d0bd0.tar.gz
otp-de4e620a3fbd40e598d8f7da01258979246d0bd0.tar.bz2
otp-de4e620a3fbd40e598d8f7da01258979246d0bd0.zip
observer: Improve debugging code in test suite
Diffstat (limited to 'lib/observer/test')
-rw-r--r--lib/observer/test/observer_SUITE.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl
index 234cf96298..0db2c1ea77 100644
--- a/lib/observer/test/observer_SUITE.erl
+++ b/lib/observer/test/observer_SUITE.erl
@@ -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(),
@@ -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");