From 4cf36eb956cf8de179ae5eb83a325e7e408eecf0 Mon Sep 17 00:00:00 2001 From: Ekaterina Tochilina Date: Fri, 10 Mar 2023 16:20:28 +0300 Subject: [PATCH] Added executions limit --- .../main/kotlin/org/utbot/python/PythonTestCaseGenerator.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utbot-python/src/main/kotlin/org/utbot/python/PythonTestCaseGenerator.kt b/utbot-python/src/main/kotlin/org/utbot/python/PythonTestCaseGenerator.kt index 44872ef545..81c335ea7e 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/PythonTestCaseGenerator.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/PythonTestCaseGenerator.kt @@ -30,6 +30,7 @@ import java.io.File private val logger = KotlinLogging.logger {} private const val RANDOM_TYPE_FREQUENCY = 6 +private const val MAX_EXECUTIONS = 50000 class PythonTestCaseGenerator( private val withMinimization: Boolean = true, @@ -167,7 +168,9 @@ class PythonTestCaseGenerator( var feedback: InferredTypeFeedback = SuccessFeedback - val fuzzerCancellation = { isCancelled() || limitManager.isCancelled() } + val fuzzerCancellation = { + isCancelled() || limitManager.isCancelled() || (errors.size + executions.size) >= MAX_EXECUTIONS + } engine.fuzzing(args, fuzzerCancellation, until).collect { when (it) {