From dd35de42dd662b1d4c88bcc6155d869eb42f65ab Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Wed, 5 Jan 2022 21:19:12 +0100 Subject: [PATCH] correct order of actions --- .../theodolite/benchmark/KubernetesBenchmarkDeployment.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt index c9c75ab32..9d32a4eea 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt @@ -46,15 +46,15 @@ class KubernetesBenchmarkDeployment( * - Deploy the needed resources. */ override fun setup() { - sutBeforeActions.forEach { it.exec(client = client) } val kafkaTopics = this.topics.filter { !it.removeOnly } .map { NewTopic(it.name, it.numPartitions, it.replicationFactor) } kafkaController.createTopics(kafkaTopics) + sutBeforeActions.forEach { it.exec(client = client) } appResources.forEach { kubernetesManager.deploy(it) } logger.info { "Wait ${this.loadGenerationDelay} seconds before starting the load generator." } Thread.sleep(Duration.ofSeconds(this.loadGenerationDelay).toMillis()) - loadGenResources.forEach { kubernetesManager.deploy(it) } loadGenBeforeActions.forEach { it.exec(client = client) } + loadGenResources.forEach { kubernetesManager.deploy(it) } } @@ -66,14 +66,14 @@ class KubernetesBenchmarkDeployment( */ override fun teardown() { loadGenResources.forEach { kubernetesManager.remove(it) } + loadGenAfterActions.forEach { it.exec(client = client) } appResources.forEach { kubernetesManager.remove(it) } + sutAfterActions.forEach { it.exec(client = client) } kafkaController.removeTopics(this.topics.map { topic -> topic.name }) ResourceByLabelHandler(client).removePods( labelName = LAG_EXPORTER_POD_LABEL_NAME, labelValue = LAG_EXPORTER_POD_LABEL_VALUE ) - sutAfterActions.forEach { it.exec(client = client) } - loadGenAfterActions.forEach { it.exec(client = client) } logger.info { "Teardown complete. Wait $afterTeardownDelay ms to let everything come down." } Thread.sleep(Duration.ofSeconds(afterTeardownDelay).toMillis()) } -- GitLab