Skip to content

Commit 32ae04f

Browse files
tochilinakdenis-fokin
authored andcommitted
Added limit for number of executions (#1925)
(cherry picked from commit 5f441ac)
1 parent 21f06bb commit 32ae04f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utbot-python/src/main/kotlin/org/utbot/python/PythonTestCaseGenerator.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import java.io.File
3030

3131
private val logger = KotlinLogging.logger {}
3232
private const val RANDOM_TYPE_FREQUENCY = 6
33+
private const val MAX_EXECUTIONS = 50000
3334

3435
class PythonTestCaseGenerator(
3536
private val withMinimization: Boolean = true,
@@ -167,7 +168,9 @@ class PythonTestCaseGenerator(
167168

168169
var feedback: InferredTypeFeedback = SuccessFeedback
169170

170-
val fuzzerCancellation = { isCancelled() || limitManager.isCancelled() }
171+
val fuzzerCancellation = {
172+
isCancelled() || limitManager.isCancelled() || (errors.size + executions.size) >= MAX_EXECUTIONS
173+
}
171174

172175
engine.fuzzing(args, fuzzerCancellation, until).collect {
173176
when (it) {

0 commit comments

Comments
 (0)