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

Unified Diff: infra/bots/recipe_modules/flavor/gn_android_flavor.py

Issue 2334223003: Android GN: don't reboot before running (Closed)
Patch Set: sleep(30) Created 4 years, 3 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 | infra/bots/recipes/swarm_test.expected/Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-GN_Android.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/recipe_modules/flavor/gn_android_flavor.py
diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
index 85ab3732d54d7901c46f1208a14b0dcefd148355..7a2864b47cbbebfa0078c1e46bb3ab01e4ed067e 100644
--- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
@@ -63,6 +63,19 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
def install(self):
self._adb('reboot', 'reboot')
borenet 2016/09/13 17:23:25 I recommend sleeping for at least 10s after issuin
self._adb('wait for device', 'wait-for-usb-device')
+ self.m.python.inline('wait for sys.boot_completed', """
+ import subprocess
+ import sys
+ import time
borenet 2016/09/13 17:23:25 I recommend folding the "adb reboot", "sleep 10",
+ time.sleep(30)
+ for attempt in range(30):
+ done = subprocess.check_output(['adb', 'shell',
+ 'getprop', 'sys.boot_completed'])
borenet 2016/09/13 17:23:25 Might want to try/catch this in case weird things
+ if done.strip() == '1':
+ sys.exit(0)
+ time.sleep(1)
+ sys.exit(1)
+ """, infra_step=True)
self._adb('TEMPORARY clear /data/local/tmp',
'shell', 'rm', '-rf', '/data/local/tmp/*')
self._adb('mkdir /data/local/tmp/resources',
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_test.expected/Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-GN_Android.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698