From: Dimitrios Markou Date: Wed, 4 Jul 2018 08:49:54 +0000 (+0300) Subject: [Bug fix] Execute teardown if SLA is set to "assert" X-Git-Tag: opnfv-7.0.0~171^2~1 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F41%2F59541%2F2;p=yardstick.git [Bug fix] Execute teardown if SLA is set to "assert" In Duration runner if SLA is set to "assert" and a SLAValidationError happens then a teardown is needed to avoid garbages in the environment. JIRA: YARDSTICK-1291 Change-Id: I9056b0da3e7e496171ed42430ffc340b5c68f108 Signed-off-by: Dimitrios Markou --- diff --git a/yardstick/benchmark/runners/duration.py b/yardstick/benchmark/runners/duration.py index 60f1fa536..14fd8bb47 100644 --- a/yardstick/benchmark/runners/duration.py +++ b/yardstick/benchmark/runners/duration.py @@ -74,6 +74,7 @@ def _worker_process(queue, cls, method_name, scenario_cfg, except y_exc.SLAValidationError as error: # SLA validation failed in scenario, determine what to do now if sla_action == "assert": + benchmark.teardown() raise elif sla_action == "monitor": LOG.warning("SLA validation failed: %s", error.args)