Skip to content

Commit a30b1de

Browse files
committed
Many similar sandboxed tests on sockets generated by Fuzzing and not minimized #1129
1 parent 312e347 commit a30b1de

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt

+9
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ import kotlinx.coroutines.job
103103
import kotlinx.coroutines.yield
104104
import org.utbot.framework.plugin.api.UtExecutionSuccess
105105
import org.utbot.framework.plugin.api.UtLambdaModel
106+
import org.utbot.framework.plugin.api.UtSandboxFailure
106107
import org.utbot.framework.plugin.api.util.executable
107108
import org.utbot.fuzzer.toFuzzerType
108109

@@ -430,6 +431,7 @@ class UtBotSymbolicEngine(
430431
parameterNameMap = { index -> names?.getOrNull(index) }
431432
fuzzerType = { try { toFuzzerType(methodUnderTest.executable.genericParameterTypes[it]) } catch (_: Throwable) { null } }
432433
}
434+
val errorStackTraceTracker = Trie(StackTraceElement::toString)
433435
val coveredInstructionTracker = Trie(Instruction::id)
434436
val coveredInstructionValues = linkedMapOf<Trie.Node<Instruction>, List<FuzzedValue>>()
435437
var attempts = 0
@@ -488,6 +490,13 @@ class UtBotSymbolicEngine(
488490
coveredInstructionValues[coverageKey] = values
489491
} else {
490492
logger.error { "Coverage is empty for $methodUnderTest with ${values.map { it.model }}" }
493+
val result = concreteExecutionResult.result
494+
if (result is UtSandboxFailure) {
495+
val stackTraceElements = result.exception.stackTrace.reversed()
496+
if (errorStackTraceTracker.add(stackTraceElements).count > 1) {
497+
return@forEach
498+
}
499+
}
491500
}
492501

493502
emit(

0 commit comments

Comments
 (0)