private static void waitAllStartupActivitiesPassed(@NotNull Project project) throws InterruptedException, ExecutionException {
    ApplicationManager.getApplication().assertIsNonDispatchThread();
    LOG.info("Waiting for startup activities");
    int timeout = Registry.intValue("batch.inspections.startup.activities.timeout", 180);
    try {
      FutureKt.asCompletableFuture(StartupManager.getInstance(project).getAllActivitiesPassedFuture()).get(timeout, TimeUnit.MINUTES);
      waitForInvokeLaterActivities();
      LOG.info("Startup activities finished");
    }
    catch (TimeoutException e) {
      String threads = ThreadDumper.dumpThreadsToString();
      throw new RuntimeException(String.format("Cannot process startup activities in %s minutes. ", timeout) +
                                 "You can try to increase batch.inspections.startup.activities.timeout registry value. " +
                                 "Thread dumps\n: " + threads, e);
    }
  }
private static void waitAllStartupActivitiesPassed(@NotNull Project project)