summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xautomated/android/tradefed/tradefed-runner.py3
-rw-r--r--automated/android/tradefed/tradefed.yaml2
2 files changed, 5 insertions, 0 deletions
diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py
index b0c5d77..ebf9b26 100755
--- a/automated/android/tradefed/tradefed-runner.py
+++ b/automated/android/tradefed/tradefed-runner.py
@@ -164,6 +164,9 @@ while child.isalive():
adb_command = "adb shell echo OK"
adb_check = subprocess.Popen(shlex.split(adb_command))
if adb_check.wait() != 0:
+ logger.debug('adb connection lost! Trying to dump logs of all invocations...')
+ child.sendline('d l')
+ time.sleep(30)
subprocess.call(['sh', '-c', '. ../../lib/sh-test-lib && . ../../lib/android-test-lib && adb_debug_info'])
logger.debug('"adb devices" output')
subprocess.call(['adb', 'devices'])
diff --git a/automated/android/tradefed/tradefed.yaml b/automated/android/tradefed/tradefed.yaml
index 5d6515e..d9db822 100644
--- a/automated/android/tradefed/tradefed.yaml
+++ b/automated/android/tradefed/tradefed.yaml
@@ -44,6 +44,8 @@ run:
# Upload test log and result files to artifactorial.
- cp -r ./${TEST_PATH}/results ./output/ || true
- cp -r ./${TEST_PATH}/logs ./output/ || true
+ # Include logs dumped from TF shell 'd l' command.
+ - if ls /tmp/tradefed*; then cp -r /tmp/tradefed* ./output || true; fi
- tar caf tradefed-output-$(date +%Y%m%d%H%M%S).tar.xz ./output
- ATTACHMENT=$(ls tradefed-output-*.tar.xz)
- ../../utils/upload-to-artifactorial.sh -a "${ATTACHMENT}" -u "${URL}" -t "${TOKEN}"