[platform UI][se] IJPL-218505 Add code to reproduce the freeze and test the fix

GitOrigin-RevId: 5d5ae98556cd3966e1b3efd3eaf8dfd70ebdccb8
This commit is contained in:
Aydar Mukhametzyanov
2025-11-18 16:52:27 +00:00
committed by intellij-monorepo-bot
parent ed48a2ce19
commit 5802df57bd
2 changed files with 25 additions and 1 deletions
@@ -6,6 +6,7 @@ import com.intellij.ide.actions.searcheverywhere.*
import com.intellij.ide.actions.searcheverywhere.PreviewExperiment.isExperimentEnabled
import com.intellij.ide.actions.searcheverywhere.statistics.SearchEverywhereUsageTriggerCollector
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project
@@ -13,6 +14,7 @@ import com.intellij.openapi.ui.popup.JBPopup
import com.intellij.openapi.ui.popup.JBPopupFactory
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.WindowStateService
import com.intellij.openapi.util.registry.Registry
import com.intellij.openapi.wm.WindowManager
import com.intellij.platform.searchEverywhere.SeProviderId
import com.intellij.platform.searchEverywhere.SeSession
@@ -53,7 +55,6 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
import javax.swing.SwingUtilities
import kotlin.String
@ApiStatus.Internal
@Service(Service.Level.PROJECT, Service.Level.APP)
@@ -108,6 +109,10 @@ class SeFrontendService(val project: Project?, private val coroutineScope: Corou
coroutineScope.launch {
val session = SeSessionEntity.createSession()
if (Registry.`is`("search.everywhere.reproduce.freeze.IJPL.218505", false)) {
reproduceFreezeIjpl218505(popupScope)
}
try {
popupSemaphore.withPermit {
val providersHolder = SeProvidersHolder.initialize(initEvent, project, session, "Frontend", false)
@@ -370,6 +375,19 @@ class SeFrontendService(val project: Project?, private val coroutineScope: Corou
return isExperimentEnabled
}
private fun reproduceFreezeIjpl218505(popupScope: CoroutineScope) {
popupScope.launch {
(1..1000).forEach { _ ->
delay(2000)
ApplicationManager.getApplication().invokeLater {
ApplicationManager.getApplication().runWriteAction {
println("write action")
}
}
}
}
}
companion object {
@JvmStatic
fun getInstance(project: Project?): SeFrontendService = project?.getService(SeFrontendService::class.java)
@@ -1320,6 +1320,12 @@ llm.welcome.guide.description=Enables Welcome Guide feature
search.everywhere.new.enabled=false
search.everywhere.new.enabled.description=Enable the new Search Everywhere implementation (excl. Rider)
search.everywhere.enable.freeze.IJPL.218505=false
search.everywhere.enable.freeze.IJPL.218505.description=Enable the freeze from IJPL-218505 Freeze in SearchEverywhereConcurrentElementsFetcher
search.everywhere.reproduce.freeze.IJPL.218505=false
search.everywhere.reproduce.freeze.IJPL.218505.description=Run reproducing conditions for freeze IJPL-218505
search.everywhere.new.minimum.width=700
search.everywhere.new.minimum.width.description=Default popup width for the new Search Everywhere implementation