Skip to content
Merged
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 @@ -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

Expand Down Expand Up @@ -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<Trie.Node<Instruction>, List<FuzzedValue>>()
var attempts = 0
Expand Down Expand Up @@ -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(
Expand Down