diff --git a/tools/benchmark-watch-install.sh b/tools/benchmark-watch-install.sh index 1e5f30f..d4c2136 100755 --- a/tools/benchmark-watch-install.sh +++ b/tools/benchmark-watch-install.sh @@ -27,7 +27,11 @@ # Measured on the Xiaomi phone (Android 12, MIUI 14): an adb-started install raises the dialog after # about 1.7 s with a ten second deny countdown, so there is time for one dump and one tap; the same # dialog is FLAG_SECURE, so a screencap of it shows whatever is behind it. -set -euo pipefail +# No `-e`: this is a watcher that has to survive for the whole run, and a single failed adb call must not +# end it. It ended silently once before, in the middle of a benchmark run, which is why it looked like it +# had "stopped running" — a helper ending in `| head -1` takes a SIGPIPE when `head` exits first, and +# `pipefail` plus `-e` turned that into an exit. +set -uo pipefail seconds=600 interval=2 @@ -83,7 +87,7 @@ is_installer() { # The window token, so the same dialog is not answered twice while it closes. window_token() { - sed -n 's/.*mCurrentFocus=Window{\([0-9a-f]*\).*/\1/p' <<<"$1" | head -1 + sed -n 's/.*mCurrentFocus=Window{\([0-9a-f]*\).*/\1/p' <<<"$1" | head -1 || true } # The activity that owns the focused window. Dialogs each get their own window token, so the token @@ -91,7 +95,7 @@ window_token() { # which is exactly what happens when a run installs twice in quick succession. The activity name is # stable across both, and it is still specific enough that a tap can only ever land on an installer. installer_activity() { - sed -n 's/.*u0 \([^ }]*\).*/\1/p' <<<"$1" | head -1 + sed -n 's/.*u0 \([^ }]*\).*/\1/p' <<<"$1" | head -1 || true } # Prints "