void () { ThreadingAssertions.assertEventDispatchThread(); long start = System.currentTimeMillis(); long deadline = start + 60_000; while (!daemonIsWorkingOrPending()) { PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue(); if (System.currentTimeMillis() > deadline) { fail("Too long waiting for daemon to start"); } } while (daemonIsWorkingOrPending()) { if (System.currentTimeMillis() > deadline) { DaemonRespondToChangesPerformanceTest.dumpThreadsToConsole(); fail("Too long waiting for daemon to finish ("+(System.currentTimeMillis()-start)+"ms already)"); } PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue(); } }