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

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

Issue 755323012: [Telemetry] Stop execution for unexpected exceptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix screenshot exception. Created 6 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/perf/measurements/smoothness_unittest.py ('k') | tools/telemetry/telemetry/page/page_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/benchmark.py
diff --git a/tools/telemetry/telemetry/benchmark.py b/tools/telemetry/telemetry/benchmark.py
index f24fef95ae13dd22943f1f531d7fa451bbf75853..e3db56275305baf509742d46db3fa473a891753a 100644
--- a/tools/telemetry/telemetry/benchmark.py
+++ b/tools/telemetry/telemetry/benchmark.py
@@ -19,6 +19,7 @@ from telemetry.page import page_test
from telemetry.page import test_expectations
from telemetry.results import results_options
from telemetry.util import cloud_storage
+from telemetry.util import exception_formatter
Disabled = decorators.Disabled
Enabled = decorators.Enabled
@@ -81,7 +82,12 @@ class Benchmark(command_line.Command):
return BenchmarkMetadata(self.Name())
def Run(self, finder_options):
- """Run this test with the given options."""
+ """Run this test with the given options.
+
+ Returns:
+ The number of failure values (up to 254) or 255 if there is an uncaught
+ exception.
+ """
self.CustomizeBrowserOptions(finder_options.browser_options)
pt = self.CreatePageTest(finder_options)
@@ -103,8 +109,10 @@ class Benchmark(command_line.Command):
results = results_options.CreateResults(benchmark_metadata, finder_options)
try:
user_story_runner.Run(pt, us, expectations, finder_options, results)
- except page_test.TestNotSupportedOnPlatformFailure as failure:
- logging.warning(str(failure))
+ return_code = min(254, len(results.failures))
+ except Exception:
+ exception_formatter.PrintFormattedException()
+ return_code = 255
bucket = cloud_storage.BUCKET_ALIASES[finder_options.upload_bucket]
if finder_options.upload_results:
@@ -112,7 +120,7 @@ class Benchmark(command_line.Command):
results.UploadProfilingFilesToCloud(bucket)
results.PrintSummary()
- return len(results.failures)
+ return return_code
def _DownloadGeneratedProfileArchive(self, options):
"""Download and extract profile directory archive if one exists."""
« no previous file with comments | « tools/perf/measurements/smoothness_unittest.py ('k') | tools/telemetry/telemetry/page/page_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698