Index: client/common_lib/test.py |
diff --git a/client/common_lib/test.py b/client/common_lib/test.py |
index 310b45dc17695610dfedef52b7744e1e4262bf42..0527ac0055f4452762b1864074141bc7172f31c9 100644 |
--- a/client/common_lib/test.py |
+++ b/client/common_lib/test.py |
@@ -200,22 +200,25 @@ class base_test(object): |
for hook in self.before_iteration_hooks: |
hook(self) |
- if profile_only: |
- if not self.job.profilers.present(): |
- self.job.record('WARN', None, None, 'No profilers have been ' |
- 'added but profile_only is set - nothing ' |
- 'will be run') |
- self.run_once_profiling(postprocess_profiled_run, *args, **dargs) |
- else: |
- self.before_run_once() |
- self.run_once(*args, **dargs) |
- self.after_run_once() |
- |
- for hook in self.after_iteration_hooks: |
- hook(self) |
+ try: |
+ if profile_only: |
+ if not self.job.profilers.present(): |
+ self.job.record('WARN', None, None, |
+ 'No profilers have been added but ' |
+ 'profile_only is set - nothing ' |
+ 'will be run') |
+ self.run_once_profiling(postprocess_profiled_run, |
+ *args, **dargs) |
+ else: |
+ self.before_run_once() |
+ self.run_once(*args, **dargs) |
+ self.after_run_once() |
- self.postprocess_iteration() |
- self.analyze_perf_constraints(constraints) |
+ self.postprocess_iteration() |
+ self.analyze_perf_constraints(constraints) |
+ finally: |
+ for hook in self.after_iteration_hooks: |
+ hook(self) |
def execute(self, iterations=None, test_length=None, profile_only=None, |