From a776057735025abc16e68cdf4576294714be495e Mon Sep 17 00:00:00 2001 From: Konstantin Nisht Date: Wed, 4 Feb 2026 12:56:12 +0100 Subject: [PATCH] [indexeing] IJPL-232427: Follow-up -- do not rely on EDT in testing of dumb tasks GitOrigin-RevId: 2e464b425fccd9b696ef4f87d088ae4606b1b18a --- .../com/intellij/openapi/project/MergingQueueGuiExecutor.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/MergingQueueGuiExecutor.kt b/platform/platform-impl/src/com/intellij/openapi/project/MergingQueueGuiExecutor.kt index 65816ec3f556..0953ca3b8254 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/MergingQueueGuiExecutor.kt +++ b/platform/platform-impl/src/com/intellij/openapi/project/MergingQueueGuiExecutor.kt @@ -20,6 +20,7 @@ import com.intellij.openapi.util.UserDataHolder import com.intellij.openapi.wm.ex.ProgressIndicatorEx import com.intellij.platform.ide.progress.withBackgroundProgress import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.InternalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.StateFlow @@ -200,13 +201,15 @@ open class MergingQueueGuiExecutor> protected construc protected open val taskId: Any? = null + private val schedulingDispatcher = Dispatchers.Default.limitedParallelism(1) + @OptIn(InternalCoroutinesApi::class) private fun startInBackgroundWithVisibleOrInvisibleProgress( onCancellation: () -> Unit, task: (ProgressIndicator) -> Unit, ) { val actionStarted = AtomicBoolean(false) - project.service().scope.launch { + project.service().scope.launch(schedulingDispatcher) { withBackgroundProgress(project, myProgressTitle) { coroutineToIndicator { indicator -> actionStarted.set(true)