Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ object UtSettings : AbstractSettings(
*/
var logConcreteExecutionErrors by getBooleanProperty(false)


/**
* Property useful only for idea
* If true - runs engine process with the ability to attach a debugger
* @see runChildProcessWithDebug
* @see org.utbot.intellij.plugin.process.EngineProcess
*/
var runIdeaProcessWithDebug by getBooleanProperty(false)

/**
* Number of branch instructions using for clustering executions in the test minimization phase.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,5 @@ object Settings {
*/
const val runChildProcessWithDebug = false

/**
* Property useful only for idea
* If true - runs engine process with the ability to attach a debugger
* @see runChildProcessWithDebug
* @see org.utbot.intellij.plugin.process.EngineProcess
*/
const val runIdeaProcessWithDebug = false

var defaultConcreteExecutorPoolSize = 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,22 @@ private fun ChildProcessModel.setup(kryoHelper: KryoHelper, synchronizer: CallsS
synchronizer.measureExecutionForTermination(invokeMethodCommand) { params ->
logger.debug { "received invokeMethod request: ${params.classname}, ${params.signature}" }
val clazz = HandlerClassesLoader.loadClass(params.classname)
val res = instrumentation.invoke(
clazz,
params.signature,
kryoHelper.readObject(params.arguments),
kryoHelper.readObject(params.parameters)
)

logger.debug { "invokeMethod result: $res" }
InvokeMethodCommandResult(kryoHelper.writeObject(res))
val res = kotlin.runCatching {
instrumentation.invoke(
clazz,
params.signature,
kryoHelper.readObject(params.arguments),
kryoHelper.readObject(params.parameters)
)
}
res.fold({
logger.debug { "invokeMethod success" }
InvokeMethodCommandResult(kryoHelper.writeObject(it))
}) {
logger.debug { "invokeMethod failure" }
logger.error(it)
throw it
}
}
synchronizer.measureExecutionForTermination(setInstrumentation) { params ->
logger.debug { "setInstrumentation request" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import kotlinx.coroutines.sync.withLock
import mu.KotlinLogging
import org.utbot.common.*
import org.utbot.framework.UtSettings
import org.utbot.framework.UtSettings.runIdeaProcessWithDebug
import org.utbot.framework.codegen.*
import org.utbot.framework.codegen.model.UtilClassKind
import org.utbot.framework.plugin.api.*
Expand All @@ -29,7 +30,6 @@ import org.utbot.framework.process.generated.*
import org.utbot.framework.process.generated.Signature
import org.utbot.framework.util.Conflict
import org.utbot.framework.util.ConflictTriggers
import org.utbot.instrumentation.Settings
import org.utbot.instrumentation.util.KryoHelper
import org.utbot.intellij.plugin.models.GenerateTestsModel
import org.utbot.intellij.plugin.ui.TestReportUrlOpeningListener
Expand Down Expand Up @@ -96,7 +96,7 @@ class EngineProcess(parent: Lifetime, val project: Project) {
}

private fun debugArgument(): String {
return "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005".takeIf { Settings.runIdeaProcessWithDebug }
return "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=5005".takeIf { runIdeaProcessWithDebug }
?: ""
}

Expand Down