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

Side by Side Diff: build/android/buildbot/bb_device_steps.py

Issue 19774008: Do not reboot emulator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import collections 6 import collections
7 import glob 7 import glob
8 import multiprocessing 8 import multiprocessing
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 except errors.DeviceUnresponsiveError as e: 77 except errors.DeviceUnresponsiveError as e:
78 return e 78 return e
79 79
80 80
81 def RebootDevices(): 81 def RebootDevices():
82 """Reboot all attached and online devices.""" 82 """Reboot all attached and online devices."""
83 # Early return here to avoid presubmit dependence on adb, 83 # Early return here to avoid presubmit dependence on adb,
84 # which might not exist in this checkout. 84 # which might not exist in this checkout.
85 if bb_utils.TESTING: 85 if bb_utils.TESTING:
86 return 86 return
87 devices = android_commands.GetAttachedDevices() 87 all_devices = android_commands.GetAttachedDevices()
frankf 2013/07/19 19:20:31 Instead of adding all this extra logic here, combi
Isaac (away) 2013/07/19 21:31:29 Yeah I agree w/ frank. Let's push this logic into
navabi 2013/07/19 23:03:44 Done. Good idea.
88
89 def IsRealDevice(device):
90 return device not in android_commands.GetEmulators()
91
92 devices = filter(IsRealDevice, all_devices)
88 print 'Rebooting: %s' % devices 93 print 'Rebooting: %s' % devices
89 if devices: 94 if devices:
90 pool = multiprocessing.Pool(len(devices)) 95 pool = multiprocessing.Pool(len(devices))
91 results = pool.map_async(RebootDeviceSafe, devices).get(99999) 96 results = pool.map_async(RebootDeviceSafe, devices).get(99999)
92 97
93 for device, result in zip(devices, results): 98 for device, result in zip(devices, results):
94 if result: 99 if result:
95 print '%s failed to startup.' % device 100 print '%s failed to startup.' % device
96 101
97 if any(results): 102 if any(results):
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 return sys.exit('Unknown tests %s' % list(unknown_tests)) 388 return sys.exit('Unknown tests %s' % list(unknown_tests))
384 389
385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) 390 setattr(options, 'target', options.factory_properties.get('target', 'Debug'))
386 391
387 MainTestWrapper(options) 392 MainTestWrapper(options)
388 provision_devices.KillHostHeartbeat() 393 provision_devices.KillHostHeartbeat()
389 394
390 395
391 if __name__ == '__main__': 396 if __name__ == '__main__':
392 sys.exit(main(sys.argv)) 397 sys.exit(main(sys.argv))
OLDNEW
« 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