From cf1334d54eb16f92120e831ac214361609db9722 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tamarin Date: Tue, 23 May 2023 18:10:44 +0300 Subject: [PATCH] Fix problem with infinitive running python-cli --- .../org/utbot/python/evaluation/PythonCoverageReceiver.kt | 5 +++++ .../org/utbot/python/evaluation/PythonWorkerManager.kt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonCoverageReceiver.kt b/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonCoverageReceiver.kt index 348f32eb35..6c46215d13 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonCoverageReceiver.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonCoverageReceiver.kt @@ -17,6 +17,11 @@ class PythonCoverageReceiver( return "localhost" to socket.localPort.toString() } + fun kill() { + socket.close() + this.interrupt() + } + override fun run() { try { while (System.currentTimeMillis() < until) { diff --git a/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonWorkerManager.kt b/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonWorkerManager.kt index a7bd0e4c41..750345d79c 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonWorkerManager.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/evaluation/PythonWorkerManager.kt @@ -65,7 +65,7 @@ class PythonWorkerManager( fun disconnect() { workerSocket.close() process.destroy() - coverageReceiver.interrupt() + coverageReceiver.kill() } fun reconnect() {