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

Unified Diff: build/android/bb_run_sharded_steps.py

Issue 11860012: Android: capture logcat for all devices on bb_run_sharded_steps.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't kill monitor Created 7 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/bb_run_sharded_steps.py
diff --git a/build/android/bb_run_sharded_steps.py b/build/android/bb_run_sharded_steps.py
index 9010d774b71066871b9f488fa430ff5aff3a17f2..167b4ee69291b16919fd5beeabd0a2b5600f0a14 100755
--- a/build/android/bb_run_sharded_steps.py
+++ b/build/android/bb_run_sharded_steps.py
@@ -45,6 +45,7 @@ import pickle
import os
import signal
import shutil
+import subprocess
import sys
from pylib import android_commands
@@ -84,6 +85,27 @@ def _RunStepsPerDevice(steps):
return results
+class _LogCatMonitor(object):
+ def __init__(self):
+ self._monitor = None
+ self._logcat_dir = os.path.join(constants.CHROME_DIR, 'out',
+ 'sharded_steps_logcat_monitor')
+
+ def __enter__(self):
+ cmd = [os.path.join(constants.CHROME_DIR, 'build', 'android',
+ 'adb_logcat_monitor.py'), self._logcat_dir]
+ self._monitor = subprocess.Popen(cmd, cwd=constants.CHROME_DIR)
+
+ def __exit__(self, *args):
+ if self._monitor:
+ # adb_logcat_printer will kill the monitor.
+ self._monitor = None
+ cmd = [os.path.join(constants.CHROME_DIR, 'build', 'android',
+ 'adb_logcat_printer.py'), self._logcat_dir]
+ cmd = subprocess.Popen(cmd, cwd=constants.CHROME_DIR)
+ cmd.wait()
+
+
def _RunShardedSteps(steps, devices):
assert steps
assert devices, 'No devices connected?'
@@ -107,9 +129,12 @@ def _RunShardedSteps(steps, devices):
print 'Start sharding (note: output is not synchronized...)'
print '*' * 80
start_time = datetime.datetime.now()
- pool = multiprocessing.Pool(processes=num_devices)
- async_results = pool.map_async(_RunStepsPerDevice, all_params)
- results_per_device = async_results.get(999999)
+
+ with _LogCatMonitor() as logcat_monitor:
+ pool = multiprocessing.Pool(processes=num_devices)
+ async_results = pool.map_async(_RunStepsPerDevice, all_params)
+ results_per_device = async_results.get(999999)
+
end_time = datetime.datetime.now()
print '*' * 80
print 'Finished sharding.'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698