From 7658e99c02d5160493cecaadbee8d9610f82a353 Mon Sep 17 00:00:00 2001 From: Jens Pots Date: Sat, 20 Jul 2024 16:14:41 +0200 Subject: [PATCH] fix: do not exit on fatal messages during testing --- src/test/kotlin/e2e/E2ETest.kt | 2 +- src/test/kotlin/runner/impl/jvm/ArgumentsTest.kt | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/kotlin/e2e/E2ETest.kt b/src/test/kotlin/e2e/E2ETest.kt index e2e0506..4009e1f 100644 --- a/src/test/kotlin/e2e/E2ETest.kt +++ b/src/test/kotlin/e2e/E2ETest.kt @@ -29,7 +29,7 @@ class E2ETest { // Execute the pipeline. runBlocking { try { - withTimeout(20_000) { exec(pipeline.path) } + withTimeout(30_000) { exec(pipeline.path) } } catch (_: TimeoutCancellationException) {} } diff --git a/src/test/kotlin/runner/impl/jvm/ArgumentsTest.kt b/src/test/kotlin/runner/impl/jvm/ArgumentsTest.kt index d95d0cf..57f07c0 100644 --- a/src/test/kotlin/runner/impl/jvm/ArgumentsTest.kt +++ b/src/test/kotlin/runner/impl/jvm/ArgumentsTest.kt @@ -1,6 +1,7 @@ package runner.impl.jvm import kotlin.test.assertEquals +import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import technology.idlab.exception.RunnerException @@ -8,6 +9,11 @@ import technology.idlab.runner.impl.jvm.Arguments import technology.idlab.util.Log class ArgumentsTest { + @BeforeEach + fun setup() { + Log.shared.setFatalMode(Log.FatalMode.EXCEPTION) + } + @Test fun single() { val args = Arguments(mapOf("key" to listOf("value"))) @@ -98,9 +104,6 @@ class ArgumentsTest { @Test fun inheritance() { - // Do not exit on fatal messages. - Log.shared.setFatalMode(Log.FatalMode.EXCEPTION) - // The base class. open class A