Skip to content

Commit 30edbb4

Browse files
Markouttedenis-fokin
authored andcommitted
Many similar sandboxed tests on sockets generated by Fuzzing and not minimized #1129 (#1132)
(cherry picked from commit b3ec3da)
1 parent 7c28142 commit 30edbb4

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

@@ -431,6 +432,7 @@ class UtBotSymbolicEngine(
431432
fuzzerType = { try { toFuzzerType(methodUnderTest.executable.genericParameterTypes[it]) } catch (_: Throwable) { null } }
432433
shouldMock = { mockStrategy.eligibleToMock(it, classUnderTest) }
433434
}
435+
val errorStackTraceTracker = Trie(StackTraceElement::toString)
434436
val coveredInstructionTracker = Trie(Instruction::id)
435437
val coveredInstructionValues = linkedMapOf<Trie.Node<Instruction>, List<FuzzedValue>>()
436438
var attempts = 0
@@ -493,6 +495,13 @@ class UtBotSymbolicEngine(
493495
coveredInstructionValues[coverageKey] = values
494496
} else {
495497
logger.error { "Coverage is empty for $methodUnderTest with ${values.map { it.model }}" }
498+
val result = concreteExecutionResult.result
499+
if (result is UtSandboxFailure) {
500+
val stackTraceElements = result.exception.stackTrace.reversed()
501+
if (errorStackTraceTracker.add(stackTraceElements).count > 1) {
502+
return@forEach
503+
}
504+
}
496505
}
497506

498507
emit(

0 commit comments

Comments
 (0)