From 425ae132f069a421231e42cb29c9bc6d2ac80f0d Mon Sep 17 00:00:00 2001 From: Alexander Bubenchikov Date: Fri, 29 May 2020 15:38:42 +0300 Subject: [PATCH] add max timeout check to gradle test GitOrigin-RevId: e794c1b44c7a70ac60debf6fc008318571685789 --- .../java/testSources/importing/GradleProjectWizardTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/gradle/java/testSources/importing/GradleProjectWizardTest.java b/plugins/gradle/java/testSources/importing/GradleProjectWizardTest.java index 27d210af2d39..90475d8dcb3f 100644 --- a/plugins/gradle/java/testSources/importing/GradleProjectWizardTest.java +++ b/plugins/gradle/java/testSources/importing/GradleProjectWizardTest.java @@ -77,7 +77,8 @@ public class GradleProjectWizardTest extends NewProjectWizardTestCase { CountDownLatch latch = new CountDownLatch(1); MessageBusConnection connection = project.getMessageBus().connect(); connection.subscribe(ProjectDataImportListener.TOPIC, path -> latch.countDown()); - while (latch.getCount() == 1) { + long start = System.currentTimeMillis(); + while (latch.getCount() == 1 && System.currentTimeMillis() < start + 60*1000) { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()); Thread.yield(); }