From eab45064155fd7823a31cba1e779501616475b55 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 14 Apr 2021 17:00:56 +0200 Subject: harness: Enable failures only on request This changes fixes a bug where the simulator obtained the incorrect failure frequency causing failures to be enabled even when the user disabled it. --- .../opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt index 90918f44..1ab67a61 100644 --- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt +++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt @@ -276,7 +276,7 @@ public class RunnerCli : CliktCommand(name = "runner") { ) val topologyId = scenario.getEmbedded(listOf("topology", "topologyId"), ObjectId::class.java) val environment = TopologyParser(topologies, topologyId) - val failureFrequency = operational.get("failureFrequency", Number::class.java)?.toDouble() ?: 24.0 * 7 + val failureFrequency = if (operational.getBoolean("failuresEnabled", false)) 24.0 * 7 else 0.0 withComputeService(clock, meterProvider, environment, allocationPolicy) { scheduler -> val failureDomain = if (failureFrequency > 0) { -- cgit v1.2.3