diff options
author | 2017-02-09 16:13:10 -0500 | |
---|---|---|
committer | 2017-02-09 21:33:35 +0000 | |
commit | 549638c8525eaa8e78ac8b758325c749cd3fba45 (patch) | |
tree | d19b3d320e23f17ed87209c35172cf2733ecad27 /infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json | |
parent | 3d1a6bc5f3124dd5cd237ccc39ead26fe4b3355f (diff) |
Prevent waiting for NexusPlayers indefinitely
Also, I noticed that sometimes the NexusPlayers would come back up such
that adb would recognize them, but not such that the sys.boot_completed
was set to 1. This was usually fixed by rebooting the devices again.
This code will reboot them up to three times in total before giving
up and killing the device.
BUG=skia:
TBR=borenet,rmistry
NOTREECHECKS=true
NOTRY=true
Change-Id: Ic2217855ad643ab256a598a3f55a67ba84ebcb25
Reviewed-on: https://skia-review.googlesource.com/8285
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json')
-rw-r--r-- | infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json b/infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json index 719449605a..ff4dbe2906 100644 --- a/infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json +++ b/infra/bots/recipe_modules/perf/example.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-GN_Android_Vulkan.json @@ -11,7 +11,7 @@ "cmd": [ "python", "-u", - "\nimport subprocess\nimport sys\nimport time\n\ntimes = 0\n\nwhile times < 30:\n print 'Waiting for the device to be connected and ready.'\n try:\n output = subprocess.check_output(['adb', 'shell',\n 'getprop', 'sys.boot_completed'])\n if '1' in output:\n print 'Connected'\n sys.exit(0)\n except subprocess.CalledProcessError:\n # no device connected/authorized yet\n pass\n time.sleep(5)\n\nprint 'Timed out waiting for device'\nsys.exit(1)\n" + "\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile kicks < 2:\n\n times = 0\n\n while times < 30:\n print 'Waiting for the device to be connected and ready.'\n try:\n times += 1\n output = subprocess.check_output(['adb', 'shell',\n 'getprop', 'sys.boot_completed'])\n if '1' in output:\n print 'Connected'\n sys.exit(0)\n except subprocess.CalledProcessError:\n # no device connected/authorized yet\n pass\n time.sleep(5)\n print 'Giving the device a \"kick\" by trying to reboot it.'\n kicks += 1\n print subprocess.check_output(['adb', 'reboot'])\n\nprint 'Timed out waiting for device'\nsys.exit(1)\n" ], "name": "wait for device", "~followup_annotations": [ @@ -20,20 +20,27 @@ "@@@STEP_LOG_LINE@python.inline@import sys@@@", "@@@STEP_LOG_LINE@python.inline@import time@@@", "@@@STEP_LOG_LINE@python.inline@@@@", - "@@@STEP_LOG_LINE@python.inline@times = 0@@@", + "@@@STEP_LOG_LINE@python.inline@kicks = 0@@@", + "@@@STEP_LOG_LINE@python.inline@while kicks < 2:@@@", "@@@STEP_LOG_LINE@python.inline@@@@", - "@@@STEP_LOG_LINE@python.inline@while times < 30:@@@", - "@@@STEP_LOG_LINE@python.inline@ print 'Waiting for the device to be connected and ready.'@@@", - "@@@STEP_LOG_LINE@python.inline@ try:@@@", - "@@@STEP_LOG_LINE@python.inline@ output = subprocess.check_output(['adb', 'shell',@@@", - "@@@STEP_LOG_LINE@python.inline@ 'getprop', 'sys.boot_completed'])@@@", - "@@@STEP_LOG_LINE@python.inline@ if '1' in output:@@@", - "@@@STEP_LOG_LINE@python.inline@ print 'Connected'@@@", - "@@@STEP_LOG_LINE@python.inline@ sys.exit(0)@@@", - "@@@STEP_LOG_LINE@python.inline@ except subprocess.CalledProcessError:@@@", - "@@@STEP_LOG_LINE@python.inline@ # no device connected/authorized yet@@@", - "@@@STEP_LOG_LINE@python.inline@ pass@@@", - "@@@STEP_LOG_LINE@python.inline@ time.sleep(5)@@@", + "@@@STEP_LOG_LINE@python.inline@ times = 0@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@ while times < 30:@@@", + "@@@STEP_LOG_LINE@python.inline@ print 'Waiting for the device to be connected and ready.'@@@", + "@@@STEP_LOG_LINE@python.inline@ try:@@@", + "@@@STEP_LOG_LINE@python.inline@ times += 1@@@", + "@@@STEP_LOG_LINE@python.inline@ output = subprocess.check_output(['adb', 'shell',@@@", + "@@@STEP_LOG_LINE@python.inline@ 'getprop', 'sys.boot_completed'])@@@", + "@@@STEP_LOG_LINE@python.inline@ if '1' in output:@@@", + "@@@STEP_LOG_LINE@python.inline@ print 'Connected'@@@", + "@@@STEP_LOG_LINE@python.inline@ sys.exit(0)@@@", + "@@@STEP_LOG_LINE@python.inline@ except subprocess.CalledProcessError:@@@", + "@@@STEP_LOG_LINE@python.inline@ # no device connected/authorized yet@@@", + "@@@STEP_LOG_LINE@python.inline@ pass@@@", + "@@@STEP_LOG_LINE@python.inline@ time.sleep(5)@@@", + "@@@STEP_LOG_LINE@python.inline@ print 'Giving the device a \"kick\" by trying to reboot it.'@@@", + "@@@STEP_LOG_LINE@python.inline@ kicks += 1@@@", + "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output(['adb', 'reboot'])@@@", "@@@STEP_LOG_LINE@python.inline@@@@", "@@@STEP_LOG_LINE@python.inline@print 'Timed out waiting for device'@@@", "@@@STEP_LOG_LINE@python.inline@sys.exit(1)@@@", |