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

Unified Diff: trunk/src/build/android/pylib/perf/setup.py

Issue 93793002: Revert 237667 "[Telemetry] Refactor common Android test harness ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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: trunk/src/build/android/pylib/perf/setup.py
===================================================================
--- trunk/src/build/android/pylib/perf/setup.py (revision 237673)
+++ trunk/src/build/android/pylib/perf/setup.py (working copy)
@@ -13,13 +13,39 @@
import shutil
import time
+from pylib import android_commands
+from pylib import cmd_helper
from pylib import constants
from pylib import forwarder
-from pylib.utils import test_environment
+from pylib import ports
import test_runner
+def _KillPendingServers():
+ for retry in range(5):
+ for server in ['lighttpd', 'web-page-replay']:
+ pids = [p.pid for p in psutil.process_iter() if server in p.name]
+ for pid in pids:
+ try:
+ logging.warning('Killing %s %s', server, pid)
+ os.kill(pid, signal.SIGQUIT)
+ except Exception as e:
+ logging.warning('Failed killing %s %s %s', server, pid, e)
+ # Restart the adb server with taskset to set a single CPU affinity.
+ cmd_helper.RunCmd([constants.ADB_PATH, 'kill-server'])
+ cmd_helper.RunCmd(['taskset', '-c', '0', constants.ADB_PATH, 'start-server'])
+ cmd_helper.RunCmd(['taskset', '-c', '0', constants.ADB_PATH, 'root'])
+ i = 1
+ while not android_commands.GetAttachedDevices():
+ time.sleep(i)
+ i *= 2
+ if i > 10:
+ break
+
+ forwarder.Forwarder.UseMultiprocessing()
+
+
def Setup(test_options):
"""Create and return the test runner factory and tests.
@@ -36,8 +62,7 @@
os.makedirs(constants.PERF_OUTPUT_DIR)
# Before running the tests, kill any leftover server.
- test_environment.CleanupLeftoverProcesses()
- forwarder.Forwarder.UseMultiprocessing()
+ _KillPendingServers()
if test_options.single_step:
# Running a single command, build the tests structure.
« no previous file with comments | « trunk/src/build/android/pylib/android_commands.py ('k') | trunk/src/build/android/pylib/utils/test_environment.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698