diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt index 0cd1cfede9d0..7909f919eb6d 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/WaitForFinishedCodeAnalysis.kt @@ -130,6 +130,9 @@ class CodeAnalysisStateListener(val project: Project, val cs: CoroutineScope) { * @throws TimeoutException when stopped due to provided [timeout] */ suspend fun waitAnalysisToFinish(timeout: Duration? = 5.minutes, throws: Boolean = false, logsError: Boolean = true) { + if (EDT.isCurrentThreadEdt()) { + throw AssertionError("waitAnalysisToFinish should not be called from EDT otherwise there will be freezes") + } LOG.info("Waiting for code analysis to finish in $timeout") val future = CompletableFuture() if (timeout != null) {