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

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

Issue 38483002: Add sleep after restarting usb ports and before checking for devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A class to keep track of devices across builds and report state.""" 7 """A class to keep track of devices across builds and report state."""
8 import logging 8 import logging
9 import optparse 9 import optparse
10 import os 10 import os
11 import re
11 import smtplib 12 import smtplib
12 import subprocess 13 import subprocess
13 import sys 14 import sys
14 import re 15 import time
15 import urllib 16 import urllib
16 17
17 import bb_annotations 18 import bb_annotations
18 import bb_utils 19 import bb_utils
19 20
20 sys.path.append(os.path.join(os.path.dirname(__file__), 21 sys.path.append(os.path.join(os.path.dirname(__file__),
21 os.pardir, os.pardir, 'util', 'lib', 22 os.pardir, os.pardir, 'util', 'lib',
22 'common')) 23 'common'))
23 import perf_tests_results_helper # pylint: disable=F0401 24 import perf_tests_results_helper # pylint: disable=F0401
24 25
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 parser.add_option('--restart-usb', action='store_true', 254 parser.add_option('--restart-usb', action='store_true',
254 help='Restart USB ports before running device check.') 255 help='Restart USB ports before running device check.')
255 options, args = parser.parse_args() 256 options, args = parser.parse_args()
256 if args: 257 if args:
257 parser.error('Unknown options %s' % args) 258 parser.error('Unknown options %s' % args)
258 259
259 if options.restart_usb: 260 if options.restart_usb:
260 rc = RestartUsb() 261 rc = RestartUsb()
261 if rc: 262 if rc:
262 return 1 263 return 1
264 time.sleep(2)
tonyg 2013/10/24 01:10:59 I think we want adb wait-for-device instead of tim
Isaac (use chromium) 2013/10/24 01:20:37 I think this actually does require sleep in worst
frankf 2013/10/24 01:30:12 wait-for-device works for particular devices (usin
navabi 2013/10/24 02:42:35 I talked to Frank about this, and I think sleep is
bulach 2013/10/24 13:01:14 FYI, one issue I saw was that there was a lingerin
bulach 2013/10/24 13:12:17 btw, dominik just tested and apparently 1s is not
navabi 2013/10/24 18:56:24 I don't think we want to stop as soon as anything
263 265
264 devices = android_commands.GetAttachedDevices() 266 devices = android_commands.GetAttachedDevices()
265 # TODO(navabi): Test to make sure this fails and then fix call 267 # TODO(navabi): Test to make sure this fails and then fix call
266 offline_devices = android_commands.GetAttachedDevices(hardware=False, 268 offline_devices = android_commands.GetAttachedDevices(hardware=False,
267 emulator=False, 269 emulator=False,
268 offline=True) 270 offline=True)
269 271
270 types, builds, batteries, reports, errors = [], [], [], [], [] 272 types, builds, batteries, reports, errors = [], [], [], [], []
271 fail_step_lst = [] 273 fail_step_lst = []
272 if devices: 274 if devices:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 # devices with critically low battery or install speed. Remove those devices 311 # devices with critically low battery or install speed. Remove those devices
310 # from testing, allowing build to continue with good devices. 312 # from testing, allowing build to continue with good devices.
311 return 1 313 return 1
312 314
313 if not devices: 315 if not devices:
314 return 1 316 return 1
315 317
316 318
317 if __name__ == '__main__': 319 if __name__ == '__main__':
318 sys.exit(main()) 320 sys.exit(main())
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