Skip to content

Commit c73361f

Browse files
committed
Reduced waiting time in loop
1 parent ad68f29 commit c73361f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

usvm-python/usvm-python-runner/src/main/kotlin/org/usvm/runner/PythonSymbolicAnalysisRunner.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ class PythonSymbolicAnalysisRunnerImpl(
7474
): Thread() {
7575
override fun run() {
7676
val start = System.currentTimeMillis()
77-
while (System.currentTimeMillis() - start < runConfig.timeoutMs && readingThread.isAlive && process.isAlive) {
78-
if (isCancelled()) {
79-
readingThread.interrupt()
80-
}
81-
TimeUnit.MILLISECONDS.sleep(100)
77+
while (System.currentTimeMillis() - start < runConfig.timeoutMs && readingThread.isAlive && process.isAlive && !isCancelled()) {
78+
sleep(10)
8279
}
8380
readingThread.interrupt()
8481
}

usvm-python/usvm-python-runner/src/test/kotlin/org/usvm/runner/manualTest.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.usvm.runner.venv.extractVenvConfig
44
import java.io.File
55

66
fun main() {
7+
val start = System.currentTimeMillis()
78
val basePath = System.getProperty("project.root")
89
val layout = TestingLayout(basePath) // StandardLayout(File(basePath, "build/distributions/usvm-python"))
910
val mypyDir = File(basePath, "build/samples_build")
@@ -22,7 +23,7 @@ fun main() {
2223
"get_info",
2324
"Point"
2425
),
25-
10_000,
26+
30_000,
2627
3_000
2728
)
2829
/*val debugRunner = DebugRunner(config)
@@ -32,7 +33,7 @@ fun main() {
3233
val receiver = PrintingResultReceiver()
3334
val runner = PythonSymbolicAnalysisRunnerImpl(config)
3435
runner.use {
35-
val start = System.currentTimeMillis()
36-
it.analyze(runConfig, receiver) { System.currentTimeMillis() - start >= 20_000 }
36+
it.analyze(runConfig, receiver) { System.currentTimeMillis() - start >= 5_000 }
3737
}
38+
println("Time: ${System.currentTimeMillis() - start}")
3839
}

0 commit comments

Comments
 (0)