diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt index 86083c30b3..f05479ff1d 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt @@ -103,6 +103,7 @@ import kotlinx.coroutines.job import kotlinx.coroutines.yield import org.utbot.framework.plugin.api.UtExecutionSuccess import org.utbot.framework.plugin.api.UtLambdaModel +import org.utbot.framework.plugin.api.UtSandboxFailure import org.utbot.framework.plugin.api.util.executable import org.utbot.fuzzer.toFuzzerType @@ -430,6 +431,7 @@ class UtBotSymbolicEngine( parameterNameMap = { index -> names?.getOrNull(index) } fuzzerType = { try { toFuzzerType(methodUnderTest.executable.genericParameterTypes[it]) } catch (_: Throwable) { null } } } + val errorStackTraceTracker = Trie(StackTraceElement::toString) val coveredInstructionTracker = Trie(Instruction::id) val coveredInstructionValues = linkedMapOf, List>() var attempts = 0 @@ -488,6 +490,13 @@ class UtBotSymbolicEngine( coveredInstructionValues[coverageKey] = values } else { logger.error { "Coverage is empty for $methodUnderTest with ${values.map { it.model }}" } + val result = concreteExecutionResult.result + if (result is UtSandboxFailure) { + val stackTraceElements = result.exception.stackTrace.reversed() + if (errorStackTraceTracker.add(stackTraceElements).count > 1) { + return@forEach + } + } } emit(