diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/SuspendingReadWriteTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/SuspendingReadWriteTest.kt index ef1936ec5143..f1d51a52fb33 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/SuspendingReadWriteTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/SuspendingReadWriteTest.kt @@ -208,8 +208,12 @@ class NonBlocking : SuspendingReadWriteTest() { application.runWriteAction { dumbService.isDumb = false } - UIUtil.dispatchAllInvocationEvents() // retry with satisfied constraint, attempt 1 - job.waitTimeout() + // retry with unsatisfied constraint + withTimeout(1000) { + while (job.isActive && isActive) { + UIUtil.dispatchAllInvocationEvents() + } + } } private fun twoAttemptJob(cs: CoroutineScope, constraints: List): Job {