Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: tools/telemetry/telemetry/multi_page_benchmark_runner.py

Issue 11348370: [Telemetry] Fix a possible source of flakiness on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/connection_gone_exception.py ('k') | tools/telemetry/telemetry/page_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « tools/telemetry/telemetry/connection_gone_exception.py ('k') | tools/telemetry/telemetry/page_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698