diff options
author | simonhatch <simonhatch@chromium.org> | 2015-06-09 15:20:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-09 22:21:20 +0000 |
commit | eca5b79197f9f2e8c15ea8e55477d424649b1cc9 (patch) | |
tree | 5cd3b01eeefd3bd4b7eab2fdc7414c5e6ce63e2c /build/android | |
parent | df345d7ae7e0a524eaab0466573f7aad68c86a88 (diff) | |
download | chromium_src-eca5b79197f9f2e8c15ea8e55477d424649b1cc9.zip chromium_src-eca5b79197f9f2e8c15ea8e55477d424649b1cc9.tar.gz chromium_src-eca5b79197f9f2e8c15ea8e55477d424649b1cc9.tar.bz2 |
Catch IOError when reading chartjson results in test_runner.py
Right now, if the results aren't there, the entire sharded perf tests step fails. This doesn't fix the underlying issue, but at least allows the rest of the tests to run and makes it clearer which step failed.
With Patch: http://simonhatch0.mon.corp.google.com:8013/builders/Android%20Nexus7v2%20Perf/builds/593
Without: http://simonhatch0.mon.corp.google.com:8013/builders/Android%20Nexus7v2%20Perf/builds/591
BUG=498412
Review URL: https://codereview.chromium.org/1176613002
Cr-Commit-Position: refs/heads/master@{#333593}
Diffstat (limited to 'build/android')
-rw-r--r-- | build/android/pylib/perf/test_runner.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py index 991fc00..0f464c3 100644 --- a/build/android/pylib/perf/test_runner.py +++ b/build/android/pylib/perf/test_runner.py @@ -233,8 +233,15 @@ class TestRunner(base_test_runner.BaseTestRunner): return '' json_output_path = os.path.join(self._output_dir, 'results-chart.json') - with open(json_output_path) as f: - return f.read() + try: + with open(json_output_path) as f: + return f.read() + except IOError: + logging.exception('Exception when reading chartjson.') + logging.error('This usually means that telemetry did not run, so it could' + ' not generate the file. Please check the device running' + ' the test.') + return '' def _LaunchPerfTest(self, test_name): """Runs a perf test. |