Skip to content

Commit 96993d9

Browse files
committed
Reduce concrete execution timeout to 1 second
1 parent 5429647 commit 96993d9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/ContestUsvm.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ fun runUsvmGeneration(
192192
}
193193
}
194194
val jcExecutions = states.mapNotNull {
195-
// TODO usvm-sbft: if we have less than `runner.timeout` budget we should only let resolver run
196-
// for `remainingBudgetMillisWithoutCodegen()` ms, right now last resolver call may exceed budget,
197-
// essentially stealing some time from codegen
198-
if (remainingBudgetMillisWithoutCodegen() > 0)
195+
if (remainingBudgetMillisWithoutCodegen() > UTestRunner.CONTEST_TEST_EXECUTION_TIMEOUT.inWholeMilliseconds)
199196
logger.debug().measureTime({ "resolver.resolve(${method.classId}.${method.signature}, ...)" }) {
200197
runCatching {
201198
resolver.resolve(jcTypedMethod, it)

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/executor/UTestRunner.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package org.utbot.contest.usvm.executor
33
import org.jacodb.api.JcClasspath
44
import org.usvm.instrumentation.executor.UTestConcreteExecutor
55
import org.usvm.instrumentation.instrumentation.JcRuntimeTraceInstrumenterFactory
6-
import org.usvm.instrumentation.util.InstrumentationModuleConstants
6+
import kotlin.time.Duration.Companion.seconds
77

88
// TODO usvm-sbft-refactoring: copied from `usvm/usvm-jvm/test`, extract this class back to USVM project
99
object UTestRunner {
10+
val CONTEST_TEST_EXECUTION_TIMEOUT = 1.seconds
1011

1112
lateinit var runner: UTestConcreteExecutor
1213

@@ -18,7 +19,7 @@ object UTestRunner {
1819
JcRuntimeTraceInstrumenterFactory::class,
1920
pathToJars,
2021
classpath,
21-
InstrumentationModuleConstants.testExecutionTimeout
22+
CONTEST_TEST_EXECUTION_TIMEOUT
2223
)
2324
}
2425
}

0 commit comments

Comments
 (0)