diff options
| author | 2016-11-04 13:03:05 +0000 | |
|---|---|---|
| committer | 2016-11-04 13:03:05 +0000 | |
| commit | d295bc888f674b4936b5730e591359b7af986793 (patch) | |
| tree | 8daef44c8569767b053743d91484e63f8a031eb4 | |
| parent | e82809a2c8f26aee1e861724908f0257018cd064 (diff) | |
Workaround adb issue in run-test.
Try a few times before giving up on fetching the architecture.
bug:32655576
Change-Id: I05c6520efa56570ebe23820fca30fc234c368c88
| -rwxr-xr-x | test/etc/run-test-jar | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 8ee4ca2873..c525b2b9bf 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -397,14 +397,26 @@ else fi if [ "$HOST" = "n" ]; then - adb_invocation=$(adb shell ls -F /data/dalvik-cache) - outcome=$? - ISA=$(echo $adb_invocation | grep -Ewo "${ARCHITECTURES_PATTERN}") + # Need to be root to query /data/dalvik-cache + adb root > /dev/null + adb wait-for-device + ISA= + ISA_adb_invocation= + ISA_outcome= + # We iterate a few times to workaround an adb issue. b/32655576 + for i in {1..10}; do + ISA_adb_invocation=$(adb shell ls -F /data/dalvik-cache) + ISA_outcome=$? + ISA=$(echo $ISA_adb_invocation | grep -Ewo "${ARCHITECTURES_PATTERN}") + if [ x"$ISA" != "x" ]; then + break; + fi + done if [ x"$ISA" = "x" ]; then echo "Unable to determine architecture" # Print a few things for helping diagnosing the problem. - echo "adb invocation output: $adb_invocation" - echo "adb invocation outcome: $outcome" + echo "adb invocation output: $ISA_adb_invocation" + echo "adb invocation outcome: $ISA_outcome" echo $(adb shell ls -F /data/dalvik-cache) echo $(adb shell ls /data/dalvik-cache) echo ${ARCHITECTURES_PATTERN} |