diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt index 30772050cf4..e6eefad1056 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt @@ -29,6 +29,8 @@ import com.intellij.debugger.settings.NodeRendererSettings import com.intellij.debugger.ui.impl.watch.* import com.intellij.debugger.ui.tree.* import com.intellij.execution.process.ProcessOutputTypes +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.application.ModalityState import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.io.FileUtil import com.intellij.psi.PsiElement @@ -122,8 +124,13 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() { doStepping(path) - val variablesView = createVariablesView() - val watchesView = createWatchesView() + var variablesView: XVariablesView? = null + var watchesView: XWatchesViewImpl? = null + + ApplicationManager.getApplication().invokeAndWait({ + variablesView = createVariablesView() + watchesView = createWatchesView() + }, ModalityState.any()) doOnBreakpoint { val exceptions = linkedMapOf() @@ -142,7 +149,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() { } finally { if (shouldPrintFrame) { - printFrame(variablesView, watchesView, PrinterConfig(skipInPrintFrame, descriptorViewOptions)) + printFrame(variablesView!!, watchesView!!, PrinterConfig(skipInPrintFrame, descriptorViewOptions)) println(fileText, ProcessOutputTypes.SYSTEM) } else { @@ -152,6 +159,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() { checkExceptions(exceptions) } + finish() }