mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Avoid grand VFS refresh in tests
This commit is contained in:
@@ -45,7 +45,6 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect;
|
||||
@@ -241,7 +240,8 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
}
|
||||
}));
|
||||
|
||||
VirtualFileManager.getInstance().refresh(false);
|
||||
// grand VFS refresh significantly slows down local tests and generally not needed
|
||||
//VirtualFileManager.getInstance().refresh(false);
|
||||
}
|
||||
else {
|
||||
editorInfos = new LinkedHashMap<VirtualFile, EditorInfo>();
|
||||
|
||||
+7
-15
@@ -21,11 +21,9 @@ import com.intellij.openapi.components.ApplicationComponent;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.impl.win32.Win32LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.newvfs.ManagingFS;
|
||||
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
|
||||
import com.intellij.openapi.vfs.newvfs.RefreshQueue;
|
||||
@@ -122,14 +120,7 @@ public final class LocalFileSystemImpl extends LocalFileSystemBase implements Ap
|
||||
if (myWatcher.isOperational()) {
|
||||
new StoreRefreshStatusThread().start();
|
||||
}
|
||||
if (SystemInfo.isWindows &&
|
||||
Win32LocalFileSystem.isAvailable() &&
|
||||
Registry.is("filesystem.useNative")) {
|
||||
myNativeFileSystem = null; //Win32LocalFileSystem.getWin32Instance();
|
||||
}
|
||||
else {
|
||||
myNativeFileSystem = null;
|
||||
}
|
||||
myNativeFileSystem = null;
|
||||
}
|
||||
|
||||
public void initComponent() {
|
||||
@@ -153,11 +144,12 @@ public final class LocalFileSystemImpl extends LocalFileSystemBase implements Ap
|
||||
}
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
refresh(false);
|
||||
}
|
||||
});
|
||||
// grand VFS refresh significantly slows down local tests and generally not needed
|
||||
//ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
// public void run() {
|
||||
// refresh(false);
|
||||
// }
|
||||
//});
|
||||
|
||||
myRootsToWatch.clear();
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ import com.intellij.openapi.util.EmptyRunnable;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl;
|
||||
import com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl;
|
||||
import com.intellij.openapi.vfs.newvfs.ManagingFS;
|
||||
@@ -596,12 +595,13 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
public static File createTempDir(@NonNls final String prefix) throws IOException {
|
||||
final File tempDirectory = FileUtil.createTempDirectory(TEST_DIR_PREFIX + prefix, null);
|
||||
myFilesToDelete.add(tempDirectory);
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
VirtualFileManager.getInstance().refresh(false);
|
||||
}
|
||||
});
|
||||
// grand VFS refresh significantly slows down local tests and generally not needed
|
||||
//ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// VirtualFileManager.getInstance().refresh(false);
|
||||
// }
|
||||
//});
|
||||
return tempDirectory;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user