@TestOnly
  public void waitForVfsEventsExecuted(long timeout, @NotNull TimeUnit unit) {
    if (!ApplicationManager.getApplication().isDispatchThread()) {
      vfsEventsExecutor.waitAllTasksExecuted(timeout, unit);
      return;
    }

    long deadline = System.nanoTime() + unit.toNanos(timeout);
    while (System.nanoTime() < deadline) {
      try {
        vfsEventsExecutor.waitAllTasksExecuted(100, TimeUnit.MILLISECONDS);
        return;
      }
      catch (TimeoutCancellationException e) {
        UIUtil.dispatchAllInvocationEvents();
      }
    }
  }
@TestOnly
  public void waitForVfsEventsExecuted(long timeout, @NotNull TimeUnit unit)