Shorten the leash on Android and retry more often

This commit is contained in:
Roland Geider
2026-08-27 23:59:12 +02:00
parent 46fb9461b0
commit e33271fc15

View File

@@ -6,8 +6,7 @@
set -euo pipefail
blocks=5
attempts=3
block_timeout=10m
attempts=5
# Homebrew installs coreutils under the g-prefixed names only
timeout=$(command -v timeout || command -v gtimeout) || {
@@ -18,6 +17,13 @@ timeout=$(command -v timeout || command -v gtimeout) || {
device_type=${1:?Usage: take-screenshots.sh <device type> [flutter drive args]}
shift
# A healthy block takes about two minutes on Android and five on Apple, where
# the Xcode build dominates. A hang never recovers, so waiting longer is waste
case $device_type in
iOS*) block_timeout=10m ;;
*) block_timeout=5m ;;
esac
# flutter drive gives up within seconds on an offline device, so wait for it
# to come back instead of burning the next attempt on it
wait_for_device() {