Skip to content

Commit 4df0a88

Browse files
committed
Use default timpeout
1 parent 6994520 commit 4df0a88

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

core/src/main/kotlin/org/evomaster/core/EMConfig.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ class EMConfig {
5959
*/
6060
const val stringLengthHardLimit = 20_000
6161

62+
/**
63+
* Default soft timeout, in milliseconds, for each Z3 solver invocation
64+
* when generating SQL data. See [sqlZ3TimeoutMs].
65+
*/
66+
const val DEFAULT_SQL_Z3_TIMEOUT_MS = 5000
67+
6268
private const val defaultExternalServiceIP = "127.0.0.4"
6369

6470
//leading zeros are allowed
@@ -1980,7 +1986,7 @@ class EMConfig {
19801986
"A value of 0 disables the timeout. Only meaningful when generateSqlDataWithZ3=true.")
19811987
@DependsOnTrueFor("generateSqlDataWithZ3")
19821988
@Min(0.0)
1983-
var sqlZ3TimeoutMs = 5000
1989+
var sqlZ3TimeoutMs = DEFAULT_SQL_Z3_TIMEOUT_MS
19841990

19851991
@Cfg("Enable EvoMaster to generate SQL data with direct accesses to the database. Use a search algorithm")
19861992
@DependsOnFalseFor("blackBox")

core/src/main/kotlin/org/evomaster/core/solver/SMTLibZ3DbConstraintSolver.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ class SMTLibZ3DbConstraintSolver() : DbConstraintSolver {
168168
val fileName = storeToTmpFile(smtLib)
169169

170170
val z3Start = System.currentTimeMillis()
171-
val z3Timeout = if (::config.isInitialized) config.sqlZ3TimeoutMs.toLong() else 0L
171+
val z3Timeout = if (::config.isInitialized) config.sqlZ3TimeoutMs.toLong()
172+
else EMConfig.DEFAULT_SQL_Z3_TIMEOUT_MS.toLong()
172173
val z3Result = try {
173174
executor.solveFromFile(fileName, z3Timeout)
174175
} finally {

0 commit comments

Comments
 (0)