aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/main.py')
-rwxr-xr-xyardstick/main.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/yardstick/main.py b/yardstick/main.py
index f270bf9ee..050a56436 100755
--- a/yardstick/main.py
+++ b/yardstick/main.py
@@ -54,6 +54,8 @@ class TaskParser(object):
def atexit_handler():
'''handler for process termination'''
+ base_runner.Runner.terminate_all()
+
if HeatStack.stacks_exist():
print "Deleting all stacks"
HeatStack.delete_all()
@@ -87,6 +89,14 @@ def run_one_scenario(scenario_cfg, context, output_file):
return runner
+def runner_join(runner):
+ '''join (wait for) a runner, exit process at runner failure'''
+ status = runner.join()
+ base_runner.Runner.release(runner)
+ if status != 0:
+ sys.exit("Runner failed")
+
+
def main():
'''yardstick main'''
@@ -110,16 +120,14 @@ def main():
# Wait for runners to finish
for runner in runners:
- runner.join()
+ runner_join(runner)
print "Runner ended, output in", prog_args.output_file
- base_runner.Runner.release(runner)
else:
# run serially
for scenario in scenarios:
runner = run_one_scenario(scenario, context, prog_args.output_file)
- runner.join()
+ runner_join(runner)
print "Runner ended, output in", prog_args.output_file
- base_runner.Runner.release(runner)
if prog_args.keep_deploy:
# keep deployment, forget about stack (hide it for exit handler)