Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
To avoid breaking tests when monitor is set
[yardstick.git]
/
yardstick
/
benchmark
/
runners
/
iteration.py
diff --git
a/yardstick/benchmark/runners/iteration.py
b/yardstick/benchmark/runners/iteration.py
index
b6d861d
..
e38ed37
100755
(executable)
--- a/
yardstick/benchmark/runners/iteration.py
+++ b/
yardstick/benchmark/runners/iteration.py
@@
-21,7
+21,8
@@
from yardstick.benchmark.runners import base
LOG = logging.getLogger(__name__)
LOG = logging.getLogger(__name__)
-def _worker_process(queue, cls, method_name, scenario_cfg):
+def _worker_process(queue, cls, method_name, scenario_cfg,
+ context_cfg, aborted):
sequence = 1
sequence = 1
@@
-33,12
+34,13
@@
def _worker_process(queue, cls, method_name, scenario_cfg):
runner_cfg['runner_id'] = os.getpid()
runner_cfg['runner_id'] = os.getpid()
- benchmark = cls(
runner
_cfg)
+ benchmark = cls(
scenario_cfg, context
_cfg)
benchmark.setup()
method = getattr(benchmark, method_name)
queue.put({'runner_id': runner_cfg['runner_id'],
benchmark.setup()
method = getattr(benchmark, method_name)
queue.put({'runner_id': runner_cfg['runner_id'],
- 'scenario_cfg': scenario_cfg})
+ 'scenario_cfg': scenario_cfg,
+ 'context_cfg': context_cfg})
sla_action = None
if "sla" in scenario_cfg:
sla_action = None
if "sla" in scenario_cfg:
@@
-53,7
+55,7
@@
def _worker_process(queue, cls, method_name, scenario_cfg):
errors = ""
try:
errors = ""
try:
- method(
scenario_cfg,
data)
+ method(data)
except AssertionError as assertion:
# SLA validation failed in scenario, determine what to do now
if sla_action == "assert":
except AssertionError as assertion:
# SLA validation failed in scenario, determine what to do now
if sla_action == "assert":
@@
-84,7
+86,8
@@
def _worker_process(queue, cls, method_name, scenario_cfg):
sequence += 1
sequence += 1
- if (errors and sla_action is None) or (sequence > iterations):
+ if (errors and sla_action is None) or \
+ (sequence > iterations or aborted.is_set()):
LOG.info("worker END")
break
LOG.info("worker END")
break
@@
-108,8
+111,9
@@
If the scenario ends before the time has elapsed, it will be started again.
'''
__execution_type__ = 'Iteration'
'''
__execution_type__ = 'Iteration'
- def _run_benchmark(self, cls, method, scenario_cfg):
+ def _run_benchmark(self, cls, method, scenario_cfg
, context_cfg
):
self.process = multiprocessing.Process(
target=_worker_process,
self.process = multiprocessing.Process(
target=_worker_process,
- args=(self.result_queue, cls, method, scenario_cfg))
+ args=(self.result_queue, cls, method, scenario_cfg,
+ context_cfg, self.aborted))
self.process.start()
self.process.start()