From e05616cba570d139c4aef3d64e748c32eff0a881 Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Wed, 8 Dec 2021 13:21:52 +0100 Subject: [PATCH] Rename property timeout to timeoutSeconds --- theodolite/crd/crd-benchmark.yaml | 12 ++++++------ theodolite/examples/operator/example-benchmark.yaml | 2 +- .../src/main/kotlin/theodolite/benchmark/Action.kt | 4 ++-- .../kotlin/theodolite/benchmark/ActionCommand.kt | 2 +- .../src/main/kotlin/theodolite/util/Configuration.kt | 2 +- .../kotlin/theodolite/benchmark/ActionCommandTest.kt | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/theodolite/crd/crd-benchmark.yaml b/theodolite/crd/crd-benchmark.yaml index 394d6cc58..e3d7f8a97 100644 --- a/theodolite/crd/crd-benchmark.yaml +++ b/theodolite/crd/crd-benchmark.yaml @@ -90,7 +90,7 @@ spec: type: array items: type: string - timeout: + timeoutSeconds: type: integer afterActions: type: array @@ -118,7 +118,7 @@ spec: type: array items: type: string - timeout: + timeoutSeconds: type: integer sut: description: The appResourceSets specifies all Kubernetes resources required to start the sut. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet. @@ -183,7 +183,7 @@ spec: type: array items: type: string - timeout: + timeoutSeconds: type: integer afterActions: type: array @@ -211,7 +211,7 @@ spec: type: array items: type: string - timeout: + timeoutSeconds: type: integer loadGenerator: description: The loadGenResourceSets specifies all Kubernetes resources required to start the load generator. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet. @@ -276,7 +276,7 @@ spec: type: array items: type: string - timeout: + timeoutSeconds: type: integer afterActions: type: array @@ -304,7 +304,7 @@ spec: type: array items: type: string - timeout: + timeoutSeconds: type: integer resourceTypes: description: A list of resource types that can be scaled for this `benchmark` resource. For each resource type the concrete values are defined in the `execution` object. diff --git a/theodolite/examples/operator/example-benchmark.yaml b/theodolite/examples/operator/example-benchmark.yaml index b66852b1d..efb3737d8 100644 --- a/theodolite/examples/operator/example-benchmark.yaml +++ b/theodolite/examples/operator/example-benchmark.yaml @@ -22,7 +22,7 @@ spec: app: busybox1 exec: command: ["rm", "test-folder"] - timeout: 90 + timeoutSeconds: 90 loadGenerator: resources: - configMap: diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/Action.kt b/theodolite/src/main/kotlin/theodolite/benchmark/Action.kt index edbffea36..35efebdc0 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/Action.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/Action.kt @@ -20,7 +20,7 @@ class Action { .exec( matchLabels = selector.pod.matchLabels, container = selector.container, - timeout = exec.timeout, + timeout = exec.timeoutSeconds, command = exec.command ) if(exitCode != 0){ @@ -44,5 +44,5 @@ class PodSelector { @RegisterForReflection class Command { lateinit var command: Array<String> - var timeout: Long = Configuration.TIMEOUT + var timeoutSeconds: Long = Configuration.TIMEOUT_SECONDS } \ No newline at end of file diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt b/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt index f1feeaeb4..c6a3f2726 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt @@ -32,7 +32,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) { fun exec( matchLabels: MutableMap<String, String>, command: Array<String>, - timeout: Long = Configuration.TIMEOUT, + timeout: Long = Configuration.TIMEOUT_SECONDS, container: String = "" ): Int { val exitCode = ExitCode() diff --git a/theodolite/src/main/kotlin/theodolite/util/Configuration.kt b/theodolite/src/main/kotlin/theodolite/util/Configuration.kt index 97fffb8c9..7b1232cd9 100644 --- a/theodolite/src/main/kotlin/theodolite/util/Configuration.kt +++ b/theodolite/src/main/kotlin/theodolite/util/Configuration.kt @@ -17,7 +17,7 @@ class Configuration( /** * Specifies how long Theodolite should wait (in sec) before aborting the execution of an action command. */ - const val TIMEOUT: Long = 30L + const val TIMEOUT_SECONDS: Long = 30L } } diff --git a/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt b/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt index 9abc5ae5a..3ec361e41 100644 --- a/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt +++ b/theodolite/src/test/kotlin/theodolite/benchmark/ActionCommandTest.kt @@ -118,7 +118,7 @@ class ActionCommandTest { action.selector.pod.matchLabels = mutableMapOf("app" to "pod") action.exec = Command() action.exec.command = arrayOf("ls") - action.exec.timeout = 10L + action.exec.timeoutSeconds = 10L assertThrows<ActionCommandFailedException> { run { action.exec(server.client) } } } -- GitLab