From d7d942b3f0b7135df86c6ca478fb54b1506237dd Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Fri, 5 Oct 2018 15:39:34 +0200 Subject: [PATCH] asyc tests: ensure history collection started before the view was disposed EA-127745 - IOE: ObjectTree.register --- .../sm/runner/ui/SMTestRunnerResultsForm.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java index 13d8691b9e77..45b692021c83 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java @@ -122,7 +122,7 @@ public class SMTestRunnerResultsForm extends TestResultsPanel private final Set myMentionedCategories = new LinkedHashSet<>(); private volatile boolean myTestsRunning = true; private AbstractTestProxy myLastSelected; - private boolean myDisposed = false; + private volatile boolean myDisposed = false; private SMTestProxy myLastFailed; private final Set myRequests = Collections.synchronizedSet(new HashSet<>()); private final Alarm myUpdateTreeRequests = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, this); @@ -331,8 +331,11 @@ public class SMTestRunnerResultsForm extends TestResultsPanel Math.max(0, myFinishedTestCount - myFailedTestCount - myIgnoredTestCount), myTotalTestCount - myStartedTestCount, myIgnoredTestCount); - UIUtil.invokeLaterIfNeeded(() -> TestsUIUtil.notifyByBalloon(myProperties.getProject(), testsRoot, myProperties, presentation)); - addToHistory(testsRoot, myProperties, this); + UIUtil.invokeLaterIfNeeded(() -> { + TestsUIUtil.notifyByBalloon(myProperties.getProject(), testsRoot, myProperties, presentation); + addToHistory(testsRoot, myProperties, this); + }); + } private void addToHistory(final SMTestProxy.SMRootTestProxy root,