diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.kt index 0f6c6b125db..b649941ff2f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/AbstractIntentionTest.kt @@ -139,16 +139,22 @@ abstract class AbstractIntentionTest : KotlinLightCodeInsightFixtureTestCase() { private fun computeUnderProgressIndicatorAndWait(compute: () -> T): T { val result = CompletableFuture() val progressIndicator = ProgressIndicatorBase() + var exceptionDuringCompute: Throwable? = null try { val task = object : Task.Backgroundable(project, "isApplicable", false) { override fun run(indicator: ProgressIndicator) { - result.complete(compute()) + try { + result.complete(compute()) + } catch(e: Throwable) { + exceptionDuringCompute = e + } } } ProgressManager.getInstance().runProcessWithProgressAsynchronously(task, progressIndicator) return result.get(10, TimeUnit.SECONDS) } finally { progressIndicator.cancel() + exceptionDuringCompute?.let { throw it } } }