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

Unified Diff: telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py

Issue 2072713003: [telemetry] Print browser standard output and log upon BrowserTestCase failures (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Make the metaclass private Created 4 years, 6 months 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 | « no previous file | telemetry/telemetry/testing/browser_test_case.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py
diff --git a/telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py b/telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py
index f0f2f04851d9a0391b2099db9a318d3c89d795d2..2750507e74c5234362c3f56ea8da0e97e8b79669 100644
--- a/telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py
+++ b/telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend_unittest.py
@@ -2,9 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from functools import wraps
-import logging
-import sys
import timeit
import unittest
@@ -19,35 +16,6 @@ from telemetry.timeline import trace_data
from telemetry.timeline import tracing_config
-def PrintBrowserStandardOutputAndLogOnFailure(test):
- @wraps(test)
- def WrappedTest(self):
- try: # pylint: disable=broad-except
- test(self)
- except Exception:
- exc_info = sys.exc_info()
-
- logging.info('========== BEGIN BROWSER STANDARD OUTPUT ==========')
- try: # pylint: disable=broad-except
- logging.info(self._browser.GetStandardOutput())
- except Exception:
- logging.exception('Failed to get browser standard output:')
- logging.info('========== END BROWSER STANDARD OUTPUT ==========')
-
- logging.info('========== BEGIN BROWSER LOG ==========')
- try: # pylint: disable=broad-except
- logging.info(self._browser.GetLogFileContents())
- except Exception:
- logging.exception('Failed to get browser log:')
- logging.info('========== END BROWSER LOG ==========')
-
- # Re-raise the original exception. Note that we can't just use 'raise'
- # without any arguments because an exception might have been thrown when
- # the browser standard output was retrieved.
- raise exc_info[0], exc_info[1], exc_info[2]
- return WrappedTest
-
-
class TracingBackendTest(tab_test_case.TabTestCase):
# Number of consecutively requested memory dumps.
@@ -75,7 +43,6 @@ class TracingBackendTest(tab_test_case.TabTestCase):
# See https://github.com/catapult-project/catapult/issues/2409.
@decorators.Disabled('win-reference')
- @PrintBrowserStandardOutputAndLogOnFailure
def testDumpMemorySuccess(self):
# Check that dumping memory before tracing starts raises an exception.
self.assertRaises(Exception, self._browser.DumpMemory)
@@ -118,7 +85,6 @@ class TracingBackendTest(tab_test_case.TabTestCase):
actual_dump_ids = [d.dump_id for d in model.IterGlobalMemoryDumps()]
self.assertEqual(actual_dump_ids, expected_dump_ids)
- @PrintBrowserStandardOutputAndLogOnFailure
def testDumpMemoryFailure(self):
# Check that dumping memory before tracing starts raises an exception.
self.assertRaises(Exception, self._browser.DumpMemory)
« no previous file with comments | « no previous file | telemetry/telemetry/testing/browser_test_case.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698