From 548c7300b9620315059ae530701425b289d81a4d Mon Sep 17 00:00:00 2001 From: Yury Kamenev Date: Thu, 5 Jan 2023 14:46:37 +0800 Subject: [PATCH] Removed redundant timeout checks and initialization --- .../utbot/framework/plugin/api/TestCaseGenerator.kt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt index c07b596680..18904a428c 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt @@ -310,8 +310,7 @@ open class TestCaseGenerator( private val halfTimeUserExpectsToWaitInMillis = userTimeout / 2 // If the half is too much for concrete execution, decrease the concrete timeout - var concreteExecutionBudgetInMillis = - min(halfTimeUserExpectsToWaitInMillis, 300L * methodsUnderTestNumber) + val concreteExecutionBudgetInMillis = min(halfTimeUserExpectsToWaitInMillis, 300L * methodsUnderTestNumber) // The symbolic execution time is the reminder but not longer than checkSolverTimeoutMillis times methods number val symbolicExecutionTimeout = userTimeout - concreteExecutionBudgetInMillis @@ -326,14 +325,6 @@ open class TestCaseGenerator( // Now we calculate the solver timeout. Each method is supposed to get some time in worst-case scenario val updatedSolverCheckTimeoutMillis = if (symbolicExecutionTimePerMethod < checkSolverTimeoutMillis) symbolicExecutionTimePerMethod else checkSolverTimeoutMillis - - init { - // Update the concrete execution time, if symbolic execution time is small - // because of UtSettings.checkSolverTimeoutMillis - concreteExecutionBudgetInMillis = userTimeout - symbolicExecutionTimeout - require(symbolicExecutionTimeout > 10) - require(concreteExecutionBudgetInMillis > 10) - } } private fun updateLifecycle(