From 1dc63be083a23d8e99b4824e04d67cdce25af946 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Thu, 12 Oct 2017 20:23:12 +0300 Subject: [PATCH] handle Done promises correctly --- .../src/com/intellij/testFramework/PlatformTestUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java index 23b1ac45c497..1a0757bf07de 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java @@ -258,7 +258,7 @@ public class PlatformTestUtil { promise.processed(ignore -> complete.set(true)); T result = null; long start = System.currentTimeMillis(); - while (!complete.get()) { + do { UIUtil.dispatchAllInvocationEvents(); try { result = promise.blockingGet(20, TimeUnit.MILLISECONDS); @@ -269,6 +269,7 @@ public class PlatformTestUtil { throw new AssertionError("The promise takes too long... aborting"); } } + while (!complete.get()); UIUtil.dispatchAllInvocationEvents(); return result; }