diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java index 0dd607b7cd2b..ec0bb59959e7 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java @@ -83,7 +83,12 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe needRebuild |= registerIndexer(extension, forceClean); } if (needRebuild) { - forceRebuild(new Throwable()); + if (ApplicationManager.getApplication().isUnitTestMode()) { + requestRebuild(); + } + else { + forceRebuild(new Throwable()); + } } dropUnregisteredIndices(); }