From bf87e81c8afc8d87b0246ca21b361f8dadd58571 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 8 May 2015 07:05:10 +0200 Subject: [PATCH] FileBasedIndexImpl: when rebuild is triggered in tests, fail immediately (or it'll fail in a much more cryptic way later) --- .../com/intellij/util/indexing/FileBasedIndexImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java index 9e2d4b7bfa4c..a2cd3a6e7335 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java @@ -1552,7 +1552,14 @@ public class FileBasedIndexImpl extends FileBasedIndex { public void requestRebuild(ID indexId, Throwable throwable) { cleanupProcessedFlag(); boolean requiresRebuildWasSet = ourRebuildStatus.get(indexId).compareAndSet(OK, REQUIRES_REBUILD); - if (requiresRebuildWasSet) LOG.info("Rebuild requested for index " + indexId, throwable); + if (requiresRebuildWasSet) { + String message = "Rebuild requested for index " + indexId; + if (ApplicationManager.getApplication().isUnitTestMode()) { + LOG.error(message, throwable); + } else { + LOG.info(message, throwable); + } + } } private UpdatableIndex getIndex(ID indexId) {