File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
utbot-python/src/main/kotlin/org/utbot/python Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import kotlinx.coroutines.currentCoroutineContext
44import kotlinx.coroutines.flow.Flow
55import kotlinx.coroutines.flow.asFlow
66import kotlinx.coroutines.flow.flow
7- import kotlinx.coroutines.flow.isActive
87import kotlinx.coroutines.isActive
98import mu.KotlinLogging
109import org.utbot.framework.plugin.api.*
@@ -204,7 +203,7 @@ class PythonEngine(
204203 )
205204 }
206205
207- fun newFuzzing (parameters : List <Type >): Flow <UtResult > = flow {
206+ fun newFuzzing (parameters : List <Type >, isCancelled : () -> Boolean ): Flow <UtResult > = flow {
208207 val additionalModules = selectedTypeMap.values.flatMap {
209208 getModulesFromAnnotation(it)
210209 }.toSet()
@@ -219,7 +218,7 @@ class PythonEngine(
219218 val coveredLines = initialCoveredLines.toMutableSet()
220219
221220 PythonFuzzing (pythonTypeStorage!! ) { description, parameterValues ->
222- if (coverageLimit < 0 )
221+ if (coverageLimit < 0 || isCancelled() )
223222 return @PythonFuzzing PythonFeedback (control = Control .STOP )
224223
225224// if (parameterValues.all { it.classId.name == "UNDEF_VALUE" }) {
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ object PythonTestCaseGenerator {
100100// var coverageLimit = 10
101101
102102 runBlockingWithCancellationPredicate(isCancelled) {
103- engine.newFuzzing(args).collect {
103+ engine.newFuzzing(args, isCancelled ).collect {
104104 val coveredBefore = coveredLines.size
105105
106106 generated + = 1
You can’t perform that action at this time.
0 commit comments