diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt index 9ff7cc09a7..c5b76a69b7 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt @@ -435,7 +435,7 @@ class UtBotSymbolicEngine( }) } fuzzedValues.forEach { values -> - if (System.currentTimeMillis() >= until) { + if (controller.job?.isActive == false || System.currentTimeMillis() >= until) { logger.info { "Fuzzing overtime: $methodUnderTest" } return@flow } diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt index ee12fd5893..2407407acd 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt @@ -62,7 +62,7 @@ class TestFlow internal constructor(block: TestFlow.() -> Unit) { isFuzzingEnabled -> { when (val value = if (isSymbolicEngineEnabled) (fuzzingValue * generationTimeout).toLong() else generationTimeout) { 0L -> engine.traverse() - generationTimeout -> engine.fuzzing() + generationTimeout -> engine.fuzzing(System.currentTimeMillis() + value) else -> flowOf( engine.fuzzing(System.currentTimeMillis() + value), engine.traverse()