Reboot PixelCs before every task

Just like the NexusPlayers, swarming can't reboot the PixelCs. This may
be causing the strange state we see in tasks like:
https://chromium-swarm.appspot.com/task?id=34ed0f1bdcd5a610&refresh=10



BUG=skia:

Change-Id: Icb0b4a5564d34093abb463ca8ef5da43d066db4a
Reviewed-on: https://skia-review.googlesource.com/9818
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2017-03-16 16:02:27 -04:00 committed by Skia Commit-Bot
parent 5fa6645dbe
commit 8627124006
6 changed files with 247 additions and 1 deletions

View File

@ -127,7 +127,8 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
self._run('ninja', ninja, '-C', self.out_dir) self._run('ninja', ninja, '-C', self.out_dir)
def install(self): def install(self):
if 'NexusPlayer' == self.m.vars.builder_cfg.get('model'): reboot_always = ['NexusPlayer', 'PixelC']
if self.m.vars.builder_cfg.get('model') in reboot_always:
self._adb('rebooting device', 'reboot') self._adb('rebooting device', 'reboot')
self._wait_for_device() self._wait_for_device()
self._adb('mkdir ' + self.device_dirs.resource_dir, self._adb('mkdir ' + self.device_dirs.resource_dir,

View File

@ -1,4 +1,53 @@
[ [
{
"cmd": [
"adb",
"reboot"
],
"cwd": "[START_DIR]/skia",
"name": "rebooting device"
},
{
"cmd": [
"python",
"-u",
"\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile True:\n\n times = 0\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 if kicks >= 3:\n break\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": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@kicks = 0@@@",
"@@@STEP_LOG_LINE@python.inline@while True:@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@ times = 0@@@",
"@@@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@ if kicks >= 3:@@@",
"@@@STEP_LOG_LINE@python.inline@ break@@@",
"@@@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)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{ {
"cmd": [ "cmd": [
"adb", "adb",

View File

@ -21,6 +21,55 @@
"@@@STEP_LOG_END@python.inline@@@" "@@@STEP_LOG_END@python.inline@@@"
] ]
}, },
{
"cmd": [
"adb",
"reboot"
],
"cwd": "[START_DIR]/skia",
"name": "rebooting device"
},
{
"cmd": [
"python",
"-u",
"\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile True:\n\n times = 0\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 if kicks >= 3:\n break\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": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@kicks = 0@@@",
"@@@STEP_LOG_LINE@python.inline@while True:@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@ times = 0@@@",
"@@@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@ if kicks >= 3:@@@",
"@@@STEP_LOG_LINE@python.inline@ break@@@",
"@@@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)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{ {
"cmd": [ "cmd": [
"adb", "adb",

View File

@ -21,6 +21,55 @@
"@@@STEP_LOG_END@python.inline@@@" "@@@STEP_LOG_END@python.inline@@@"
] ]
}, },
{
"cmd": [
"adb",
"reboot"
],
"cwd": "[START_DIR]/skia",
"name": "rebooting device"
},
{
"cmd": [
"python",
"-u",
"\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile True:\n\n times = 0\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 if kicks >= 3:\n break\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": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@kicks = 0@@@",
"@@@STEP_LOG_LINE@python.inline@while True:@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@ times = 0@@@",
"@@@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@ if kicks >= 3:@@@",
"@@@STEP_LOG_LINE@python.inline@ break@@@",
"@@@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)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{ {
"cmd": [ "cmd": [
"adb", "adb",

View File

@ -1,4 +1,53 @@
[ [
{
"cmd": [
"adb",
"reboot"
],
"cwd": "[START_DIR]/skia",
"name": "rebooting device"
},
{
"cmd": [
"python",
"-u",
"\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile True:\n\n times = 0\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 if kicks >= 3:\n break\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": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@kicks = 0@@@",
"@@@STEP_LOG_LINE@python.inline@while True:@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@ times = 0@@@",
"@@@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@ if kicks >= 3:@@@",
"@@@STEP_LOG_LINE@python.inline@ break@@@",
"@@@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)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{ {
"cmd": [ "cmd": [
"adb", "adb",

View File

@ -21,6 +21,55 @@
"@@@STEP_LOG_END@python.inline@@@" "@@@STEP_LOG_END@python.inline@@@"
] ]
}, },
{
"cmd": [
"adb",
"reboot"
],
"cwd": "[START_DIR]/skia",
"name": "rebooting device"
},
{
"cmd": [
"python",
"-u",
"\nimport subprocess\nimport sys\nimport time\n\nkicks = 0\nwhile True:\n\n times = 0\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 if kicks >= 3:\n break\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": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@kicks = 0@@@",
"@@@STEP_LOG_LINE@python.inline@while True:@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@ times = 0@@@",
"@@@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@ if kicks >= 3:@@@",
"@@@STEP_LOG_LINE@python.inline@ break@@@",
"@@@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)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{ {
"cmd": [ "cmd": [
"adb", "adb",