From c6335b5ae9278b01f8685a6854e7c2efd76543de Mon Sep 17 00:00:00 2001 From: Egor Ushakov Date: Thu, 2 Oct 2025 19:02:44 +0200 Subject: [PATCH] [debugger] more stable tests GitOrigin-RevId: e307d131dea1a24880c350aa3591fc98543f519a --- .../impl/src/com/intellij/debugger/impl/DebugUtils.kt | 9 ++++++++- .../src/com/intellij/debugger/DebuggerTestCase.java | 1 + platform/util/resources/misc/registry.properties | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebugUtils.kt b/java/debugger/impl/src/com/intellij/debugger/impl/DebugUtils.kt index 2f6719590db3..cb1ea2b30980 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/DebugUtils.kt +++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebugUtils.kt @@ -19,6 +19,7 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.consumeEach import kotlinx.coroutines.future.await import kotlinx.coroutines.launch +import java.util.concurrent.CompletableFuture import kotlin.coroutines.cancellation.CancellationException /** @@ -91,7 +92,13 @@ inline fun computeSafeIfAny(ep: ExtensionPointName, processor: ( // TODO: move into VirtualMachineProxyImpl when converted to kotlin fun preloadAllClasses(vm: VirtualMachine) { DebuggerManagerThreadImpl.assertIsManagerThread() - val allClasses = DebuggerUtilsAsync.allCLasses(vm) + val allClasses = + if (Registry.`is`("debugger.preload.types.async", true)) { + DebuggerUtilsAsync.allCLasses(vm) + } + else { + CompletableFuture.completedFuture(vm.allClasses()) + } if (!Registry.`is`("debugger.preload.types.hierarchy", true) || DebuggerUtils.isAndroidVM(vm)) return val channel = Channel(capacity = Channel.UNLIMITED) diff --git a/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java b/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java index 7858f3e12401..e939dfb31d06 100644 --- a/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java +++ b/java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java @@ -630,6 +630,7 @@ public abstract class DebuggerTestCase extends ExecutionWithDebuggerToolsTestCas ApplicationManagerEx.setInStressTest(true); setRegistryPropertyForTest("debugger.track.instrumentation", "false"); setRegistryPropertyForTest("debugger.evaluate.single.threaded.timeout", "-1"); + setRegistryPropertyForTest("debugger.preload.types.async", "false"); setRegistryPropertyForTest("debugger.preload.types.hierarchy", "false"); boolean dfa = ViewsGeneralSettings.getInstance().USE_DFA_ASSIST; diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 854dc32bda5c..47b3b6f789b9 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -717,6 +717,7 @@ debugger.auto.attach.from.console.description=Auto attach to all processes avail debugger.auto.attach.from.any.console=false debugger.auto.attach.from.any.console.description=Auto attach to all processes from any console output debugger.preload.event.info=true +debugger.preload.types.async=true debugger.preload.types.hierarchy=true debugger.preload.types.hierarchy.description=Request superclass and interfaces for each loaded class in advance to speed up further operations debugger.sync.commands.reschedule.delay=50