add max timeout check to gradle test

GitOrigin-RevId: e794c1b44c7a70ac60debf6fc008318571685789
This commit is contained in:
Alexander Bubenchikov
2020-05-29 15:41:06 +03:00
committed by intellij-monorepo-bot
parent 614055bec1
commit 425ae132f0
@@ -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();
}