Index: tools/telemetry/telemetry/multi_page_benchmark_runner.py |
diff --git a/tools/telemetry/telemetry/multi_page_benchmark_runner.py b/tools/telemetry/telemetry/multi_page_benchmark_runner.py |
index 002e559c570195c561fd1bac733e2f66f61309c6..868d1f0de8c46f61da382fbef32ca690ec68aaf6 100755 |
--- a/tools/telemetry/telemetry/multi_page_benchmark_runner.py |
+++ b/tools/telemetry/telemetry/multi_page_benchmark_runner.py |
@@ -8,6 +8,7 @@ import os |
import sys |
from telemetry import all_page_interactions # pylint: disable=W0611 |
+from telemetry import connection_gone_exception |
from telemetry import browser_finder |
from telemetry import browser_options |
from telemetry import discover |
@@ -66,20 +67,27 @@ def Main(benchmark_dir): |
Use --browser=list to figure out which are available.\n""" |
sys.exit(1) |
- if options.output_format == 'csv': |
- results = multi_page_benchmark.CsvBenchmarkResults(csv.writer(sys.stdout)) |
- elif options.output_format == 'terminal-block': |
- results = multi_page_benchmark.TerminalBlockBenchmarkResults(sys.stdout) |
- else: |
- raise Exception('Invalid --output-format value: "%s". Valid values are ' |
- '"csv" and "terminal-block".' |
- % options.output_format) |
- |
- with page_runner.PageRunner(ps) as runner: |
- runner.Run(options, possible_browser, benchmark, results) |
- # When using an exact executable, assume it is a reference build for the |
- # purpose of outputting the perf results. |
- results.PrintSummary(options.browser_executable and '_ref' or '') |
+ retries = 3 |
+ while retries: |
nduca
2012/12/04 04:07:47
This shouldn't be done. We really need to robustly
|
+ try: |
+ if options.output_format == 'csv': |
+ results = multi_page_benchmark.CsvBenchmarkResults( |
+ csv.writer(sys.stdout)) |
+ elif options.output_format == 'terminal-block': |
+ results = multi_page_benchmark.TerminalBlockBenchmarkResults(sys.stdout) |
+ else: |
+ raise Exception('Invalid --output-format value: "%s". Valid values are ' |
+ '"csv" and "terminal-block".' |
+ % options.output_format) |
+ with page_runner.PageRunner(ps) as runner: |
+ runner.Run(options, possible_browser, benchmark, results) |
+ # When using an exact executable, assume it is a reference build for the |
+ # purpose of outputting the perf results. |
+ results.PrintSummary(options.browser_executable and '_ref' or '') |
+ retries = 0 |
+ except connection_gone_exception.ConnectionGoneException: |
+ logging.warning('Lost connection to browser. Retrying.') |
+ retries -= 1 |
if len(results.page_failures): |
logging.warning('Failed pages: %s', '\n'.join( |