Skip to content
Snippets Groups Projects
Commit e05616cb authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Rename property timeout to timeoutSeconds

parent 96c3e7d0
No related branches found
No related tags found
1 merge request!201Introduce action commands
...@@ -90,7 +90,7 @@ spec: ...@@ -90,7 +90,7 @@ spec:
type: array type: array
items: items:
type: string type: string
timeout: timeoutSeconds:
type: integer type: integer
afterActions: afterActions:
type: array type: array
...@@ -118,7 +118,7 @@ spec: ...@@ -118,7 +118,7 @@ spec:
type: array type: array
items: items:
type: string type: string
timeout: timeoutSeconds:
type: integer type: integer
sut: 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. 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: ...@@ -183,7 +183,7 @@ spec:
type: array type: array
items: items:
type: string type: string
timeout: timeoutSeconds:
type: integer type: integer
afterActions: afterActions:
type: array type: array
...@@ -211,7 +211,7 @@ spec: ...@@ -211,7 +211,7 @@ spec:
type: array type: array
items: items:
type: string type: string
timeout: timeoutSeconds:
type: integer type: integer
loadGenerator: 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. 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: ...@@ -276,7 +276,7 @@ spec:
type: array type: array
items: items:
type: string type: string
timeout: timeoutSeconds:
type: integer type: integer
afterActions: afterActions:
type: array type: array
...@@ -304,7 +304,7 @@ spec: ...@@ -304,7 +304,7 @@ spec:
type: array type: array
items: items:
type: string type: string
timeout: timeoutSeconds:
type: integer type: integer
resourceTypes: 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. 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.
......
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
app: busybox1 app: busybox1
exec: exec:
command: ["rm", "test-folder"] command: ["rm", "test-folder"]
timeout: 90 timeoutSeconds: 90
loadGenerator: loadGenerator:
resources: resources:
- configMap: - configMap:
......
...@@ -20,7 +20,7 @@ class Action { ...@@ -20,7 +20,7 @@ class Action {
.exec( .exec(
matchLabels = selector.pod.matchLabels, matchLabels = selector.pod.matchLabels,
container = selector.container, container = selector.container,
timeout = exec.timeout, timeout = exec.timeoutSeconds,
command = exec.command command = exec.command
) )
if(exitCode != 0){ if(exitCode != 0){
...@@ -44,5 +44,5 @@ class PodSelector { ...@@ -44,5 +44,5 @@ class PodSelector {
@RegisterForReflection @RegisterForReflection
class Command { class Command {
lateinit var command: Array<String> lateinit var command: Array<String>
var timeout: Long = Configuration.TIMEOUT var timeoutSeconds: Long = Configuration.TIMEOUT_SECONDS
} }
\ No newline at end of file
...@@ -32,7 +32,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) { ...@@ -32,7 +32,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) {
fun exec( fun exec(
matchLabels: MutableMap<String, String>, matchLabels: MutableMap<String, String>,
command: Array<String>, command: Array<String>,
timeout: Long = Configuration.TIMEOUT, timeout: Long = Configuration.TIMEOUT_SECONDS,
container: String = "" container: String = ""
): Int { ): Int {
val exitCode = ExitCode() val exitCode = ExitCode()
......
...@@ -17,7 +17,7 @@ class Configuration( ...@@ -17,7 +17,7 @@ class Configuration(
/** /**
* Specifies how long Theodolite should wait (in sec) before aborting the execution of an action command. * 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
} }
} }
...@@ -118,7 +118,7 @@ class ActionCommandTest { ...@@ -118,7 +118,7 @@ class ActionCommandTest {
action.selector.pod.matchLabels = mutableMapOf("app" to "pod") action.selector.pod.matchLabels = mutableMapOf("app" to "pod")
action.exec = Command() action.exec = Command()
action.exec.command = arrayOf("ls") action.exec.command = arrayOf("ls")
action.exec.timeout = 10L action.exec.timeoutSeconds = 10L
assertThrows<ActionCommandFailedException> { run { action.exec(server.client) } } assertThrows<ActionCommandFailedException> { run { action.exec(server.client) } }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment