From 033aeadc704111ed7e8ff8dc6fe79db25260b87e Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 7 Nov 2016 15:45:55 +0300 Subject: [PATCH] reveal the failure source earlier --- .../openapi/progress/impl/ProgressIndicatorTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java index ded620d675df..1c1cfd78857b 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java @@ -316,6 +316,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { @Override public void checkCanceled() throws ProcessCanceledException { checkCanceledCalled = true; + throw new RuntimeException("must not call checkCanceled()"); } }); ProgressManager.getInstance().executeProcessUnderProgress(() -> { @@ -617,7 +618,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { try { Future future = ApplicationManager.getApplication().executeOnPooledThread( () -> ProgressManager.getInstance().runProcess( - () -> assertInvokeAndWaitWorks(), + ProgressIndicatorTest::assertInvokeAndWaitWorks, ProgressWrapper.wrap(indicator))); future.get(2000, TimeUnit.MILLISECONDS); } @@ -631,7 +632,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { private static void assertInvokeAndWaitWorks() { Semaphore semaphore = new Semaphore(); semaphore.down(); - ApplicationManager.getApplication().invokeLater(() -> semaphore.up()); + ApplicationManager.getApplication().invokeLater(semaphore::up); assertTrue("invokeAndWait would deadlock", semaphore.waitFor(1000)); } }