diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt index ca5ca7993216230e99045a7c5a2edbefaffe9706..e63f733076bb1c2764a88d62237b703f645ca796 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt @@ -54,7 +54,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) { .writingOutput(out) .writingError(error) .writingErrorChannel(errChannelStream) - .usingListener(MyPodExecListener(execLatch)) + .usingListener(ActionCommandListener(execLatch)) .exec(*command) val latchTerminationStatus = execLatch.await(timeout, TimeUnit.SECONDS); @@ -105,7 +105,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) { }.toInt() } - fun getPodName(matchLabels: MutableMap<String, String>, tries: Int): String { + private fun getPodName(matchLabels: MutableMap<String, String>, tries: Int): String { for (i in 1..tries) { try { @@ -136,13 +136,13 @@ class ActionCommand(val client: NamespacedKubernetesClient) { } } - private class MyPodExecListener(val execLatch: CountDownLatch) : ExecListener { + private class ActionCommandListener(val execLatch: CountDownLatch) : ExecListener { override fun onOpen(response: Response) { } override fun onFailure(throwable: Throwable, response: Response) { execLatch.countDown() - throw ActionCommandFailedException("Some error encountered while executing action.", throwable) + throw ActionCommandFailedException("Some error encountered while executing action, caused ${throwable.message})") } override fun onClose(code: Int, reason: String) { diff --git a/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt b/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt index f6ef7d91228e9a2eb626fc7c55c565924ce3f64f..71001ac6f825005b7d5305172f2f045f74025c56 100644 --- a/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt +++ b/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt @@ -8,7 +8,6 @@ import io.fabric8.kubernetes.client.utils.Utils import io.quarkus.test.junit.QuarkusTest import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertTrue import theodolite.execution.operator.TheodoliteController import theodolite.execution.operator.TheodoliteOperator import theodolite.util.ActionCommandFailedException