From e734b3f7ccb95a208015cd9d27471eb55ec5635a Mon Sep 17 00:00:00 2001 From: Dmitrii Timofeev Date: Wed, 12 Oct 2022 14:16:30 +0400 Subject: [PATCH] Rethrow CancellationException to ensure stop by timeout --- .../org/utbot/framework/plugin/api/TestCaseGenerator.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt index d16101086c..823dae8c8b 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt @@ -184,8 +184,11 @@ open class TestCaseGenerator( is UtError -> method2errors.getValue(method).merge(it.description, 1, Int::plus) } } + } catch (e: CancellationException) { + logger.info(e) { "Test generation cancelled" } + throw(e) } catch (e: Exception) { - logger.error(e) {"Error in engine"} + logger.error(e) { "Error in engine" } } } controller.paused = true