File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
utbot-junit-contest/src/main/kotlin/org/utbot Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ fun runGeneration(
290
290
UtSettings .fuzzingTimeoutInMillis = (budgetForMethod * fuzzingRatio).toLong()
291
291
292
292
// start controller that will activate symbolic execution
293
- GlobalScope .launch {
293
+ GlobalScope .launch(currentContext) {
294
294
delay(budgetForSymbolicExecution)
295
295
296
296
if (methodJob.isActive) {
@@ -371,7 +371,7 @@ fun runGeneration(
371
371
}
372
372
373
373
374
- val cancellator = GlobalScope .launch {
374
+ val cancellator = GlobalScope .launch(currentContext) {
375
375
delay(remainingBudget())
376
376
if (engineJob.isActive) {
377
377
logger.warn { " Cancelling job because timeout $generationTimeout ms elapsed (real cancellation can take time)" }
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ package org.utbot.monitoring
3
3
import java.io.File
4
4
import java.util.concurrent.TimeUnit
5
5
import kotlin.system.exitProcess
6
+ import kotlinx.coroutines.GlobalScope
7
+ import kotlinx.coroutines.cancel
8
+ import kotlinx.coroutines.cancelChildren
9
+ import kotlinx.coroutines.job
6
10
import kotlinx.serialization.encodeToString
7
11
import kotlinx.serialization.json.Json
8
12
import mu.KotlinLogging
@@ -14,6 +18,7 @@ import org.utbot.contest.GlobalStats
14
18
import org.utbot.contest.Paths
15
19
import org.utbot.contest.Tool
16
20
import org.utbot.contest.runEstimator
21
+ import org.utbot.framework.plugin.api.util.utContext
17
22
import org.utbot.framework.plugin.services.JdkInfoService
18
23
import org.utbot.instrumentation.ConcreteExecutor
19
24
@@ -71,6 +76,8 @@ fun main(args: Array<String>) {
71
76
72
77
}
73
78
79
+ utContext.cancelChildren()
80
+ utContext.cancel()
74
81
ConcreteExecutor .defaultPool.forceTerminateProcesses()
75
82
System .gc()
76
83
}
You can’t perform that action at this time.
0 commit comments