From d7c3362752f86aac0a0a1e53a221dd516f4da71c Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Fri, 1 May 2026 11:01:06 +0200 Subject: [PATCH] ci/android: Fix intermittent adb root failures The combined $ADB wait-for-device root command can be flaky with Cuttlefish, sometimes failing with: "adb: unable to connect for root: closed" Signed-off-by: Valentine Burley Part-of: --- .gitlab-ci/android-runner.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/android-runner.sh b/.gitlab-ci/android-runner.sh index e5c421ca5af..b9796abba65 100755 --- a/.gitlab-ci/android-runner.sh +++ b/.gitlab-ci/android-runner.sh @@ -8,8 +8,18 @@ set -uex : "${ADB:=adb}" -$ADB wait-for-device root -sleep 1 +$ADB wait-for-device +for i in $(seq 1 5); do + if $ADB root; then + break + fi + if [ "$i" -eq 5 ]; then + echo "Failed to get adb root after 5 attempts" + exit 1 + fi + sleep 2 +done +$ADB wait-for-device # overlay