void () { EdtTestUtil.runInEdtAndWait(() -> { VirtualDirectoryImpl vTemp = (VirtualDirectoryImpl)LocalFileSystem.getInstance().refreshAndFindFileByIoFile(tempDir.getRoot()); assertThat(vTemp.getChildren()).isEmpty(); tempDir.newFile("x.txt"); ProgressManager.getInstance().run(new Task.Modal(null, "", false) { @Override public void run(@NotNull ProgressIndicator indicator) { ApplicationManager.getApplication().assertIsNonDispatchThread(); Semaphore semaphore = new Semaphore(1); vTemp.refresh(true, true, semaphore::up); assertTrue(semaphore.waitFor(10_000)); assertThat(vTemp.getChildren()).hasSize(1); } }); }); }