From 06976e0219782a24bb781a57718a203d0dd27121 Mon Sep 17 00:00:00 2001 From: Stefan Xenos Date: Thu, 14 Dec 2017 13:46:53 +0300 Subject: [PATCH] Attach LeakHunter output to the exception message for better diagnostic output in test results. --- .../src/com/intellij/testFramework/LeakHunter.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/LeakHunter.java b/platform/testFramework/src/com/intellij/testFramework/LeakHunter.java index bcbd5d70c736..bdea425fb508 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LeakHunter.java +++ b/platform/testFramework/src/com/intellij/testFramework/LeakHunter.java @@ -60,12 +60,13 @@ public class LeakHunter { @Nullable final Condition isReallyLeak) throws AssertionError { processLeaks(roots, suspectClass, isReallyLeak, (leaked, backLink)->{ String place = leaked instanceof Project ? PlatformTestCase.getCreationPlace((Project)leaked) : ""; - System.out.println("Found leaked "+leaked.getClass() + ": "+leaked + - "; hash: " + System.identityHashCode(leaked) + "; place: " + place); - System.out.println(backLink); + String message ="Found leaked "+leaked.getClass() + ": "+leaked + + "; hash: " + System.identityHashCode(leaked) + "; place: " + place + "\n" + + backLink; + System.out.println(message); System.out.println(";-----"); - throw new AssertionError(); + throw new AssertionError(message); }); }