From 5acee5a700798e8754387a44f4d1a0fd7d980ee3 Mon Sep 17 00:00:00 2001 From: "ilevy@chromium.org" Date: Tue, 25 Dec 2012 06:09:44 +0000 Subject: [PATCH] Android buildbot fixes - Move adb restart commands so they are only run on tests. - Sleep after 'adb start-server' to avoid the false positive device alerts. - Save Test Report logs with unique filename so they are easier to print. BUG=163476, 165999 TBR=frankf Review URL: https://codereview.chromium.org/11669022 git-svn-id: http://src.chromium.org/svn/trunk/src/build@174596 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- android/buildbot/buildbot_functions.sh | 8 +++++--- android/pylib/test_result.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/android/buildbot/buildbot_functions.sh b/android/buildbot/buildbot_functions.sh index 034305545..7e14f56b8 100755 --- a/android/buildbot/buildbot_functions.sh +++ b/android/buildbot/buildbot_functions.sh @@ -64,9 +64,6 @@ function bb_baseline_setup { unset CXX_target fi - adb kill-server - adb start-server - local build_path="${SRC_ROOT}/out/${BUILDTYPE}" local landmines_triggered_path="$build_path/.landmines_triggered" python "$SRC_ROOT/build/landmines.py" @@ -406,6 +403,11 @@ function bb_extract_build { # Does not break build if a phone fails to restart function bb_reboot_phones { echo "@@@BUILD_STEP Rebooting phones@@@" + # Restart adb to work around bugs, sleep to wait for usb discovery. + adb kill-server + adb start-server + sleep .5 + ( set +e cd $CHROME_SRC/build/android/pylib; diff --git a/android/pylib/test_result.py b/android/pylib/test_result.py index fba9ef124..28258da2a 100644 --- a/android/pylib/test_result.py +++ b/android/pylib/test_result.py @@ -6,6 +6,7 @@ import json import logging import os +import re import time import traceback @@ -133,7 +134,8 @@ class TestResults(object): build_type, 'test_logs') if not os.path.exists(log_file_path): os.mkdir(log_file_path) - full_file_name = os.path.join(log_file_path, test_type) + full_file_name = os.path.join( + log_file_path, re.sub('\W', '_', test_type).lower() + '.log') if not os.path.exists(full_file_name): with open(full_file_name, 'w') as log_file: print >> log_file, '\n%s results for %s build %s:' % (