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

Unified Diff: telemetry/telemetry/internal/platform/profiler/tcmalloc_heap_profiler.py

Issue 2709523005: [Telemetry] Switch RunShellCommand clients to check_return=True (Closed)
Patch Set: revert change in chown command Created 3 years, 10 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
Index: telemetry/telemetry/internal/platform/profiler/tcmalloc_heap_profiler.py
diff --git a/telemetry/telemetry/internal/platform/profiler/tcmalloc_heap_profiler.py b/telemetry/telemetry/internal/platform/profiler/tcmalloc_heap_profiler.py
index 17df9ab2222ad2d30cd74344164cb6120cb9b76f..f7f5b2fb032cf7128b37f494276f3337574ba495 100644
--- a/telemetry/telemetry/internal/platform/profiler/tcmalloc_heap_profiler.py
+++ b/telemetry/telemetry/internal/platform/profiler/tcmalloc_heap_profiler.py
@@ -43,18 +43,24 @@ class _TCMallocHeapProfilerAndroid(object):
if not self._browser_backend.device.FileExists(
self._DEFAULT_DEVICE_DIR):
self._browser_backend.device.RunShellCommand(
- 'mkdir -p ' + self._DEFAULT_DEVICE_DIR)
+ ['mkdir', '-p', self._DEFAULT_DEVICE_DIR], check_return=True)
self._browser_backend.device.RunShellCommand(
- 'chmod 777 ' + self._DEFAULT_DEVICE_DIR)
+ ['chmod', '777', self._DEFAULT_DEVICE_DIR], check_return=True)
device_configured = True
if device_configured:
raise Exception('Device required special config, run again.')
def CollectProfile(self):
- self._browser_backend.device.PullFile(
- self._DEFAULT_DEVICE_DIR, self._output_path)
+ try:
+ self._browser_backend.device.PullFile(
+ self._DEFAULT_DEVICE_DIR, self._output_path)
+ except:
+ logging.exception('New exception caused by DeviceUtils conversion')
+ raise
+ # Note: command must be passed as a string to expand wildcards.
self._browser_backend.device.RunShellCommand(
- 'rm ' + os.path.join(self._DEFAULT_DEVICE_DIR, '*'))
+ 'rm -f ' + os.path.join(self._DEFAULT_DEVICE_DIR, '*'),
+ check_return=True)
if os.path.exists(self._output_path):
logging.info('TCMalloc dumps pulled to %s', self._output_path)
with file(os.path.join(self._output_path,

Powered by Google App Engine
This is Rietveld 408576698