mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid synchronous index rebuild in tests to avoid problems with read action at hand
This commit is contained in:
@@ -1210,6 +1210,10 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
|
||||
@Nullable
|
||||
public static Throwable getCauseToRebuildIndex(@NotNull RuntimeException e) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
// avoid rebuilding index in tests since we do it synchronously in requestRebuild and we can have readAction at hand
|
||||
return null;
|
||||
}
|
||||
if (e instanceof IndexOutOfBoundsException) return e; // something wrong with direct byte buffer
|
||||
Throwable cause = e.getCause();
|
||||
if (cause instanceof StorageException || cause instanceof IOException ||
|
||||
|
||||
Reference in New Issue
Block a user