Skip to content

Commit 7caffcb

Browse files
committed
ci(e2e): make Maestro install fail loud + retry on curl flake
curl ... | bash without pipefail returns the exit status of bash, which exits 0 even when the upstream curl fails with a TLS reset. That left a prior run with "Maestro installed" in the workflow's accounting but no actual binary, which downstream surfaced as a cryptic xargs: maestro: No such file or directory exit code 127 right after a successful 5-min Android build. Add `set -o pipefail`, retry the install up to 3 times, verify the binary exists at $HOME/.maestro/bin/maestro before declaring success, and print its version so a regression here is loud the next time it happens.
1 parent b7559fa commit 7caffcb

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/mobile-e2e.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,23 @@ jobs:
261261
script: echo "Generated AVD snapshot for caching."
262262

263263
- name: Install Maestro
264+
# Use pipefail + verify the binary so a curl flake (e.g. TLS reset
265+
# against github.com:443) doesn't leave us with an "installed" but
266+
# missing maestro binary, which downstream xargs invocations only
267+
# surface as a cryptic exit-code-127 after the build.
264268
run: |
265-
curl -Ls "https://get.maestro.mobile.dev" | bash
269+
set -o pipefail
270+
installed=0
271+
for i in 1 2 3; do
272+
if curl -fLs --retry 3 --retry-delay 5 "https://get.maestro.mobile.dev" | bash; then
273+
if [ -x "$HOME/.maestro/bin/maestro" ]; then installed=1; break; fi
274+
fi
275+
echo "Maestro install attempt $i failed (or binary missing); retrying"
276+
sleep 5
277+
done
278+
[ "$installed" = 1 ] || { echo "::error::Maestro install failed after 3 attempts"; exit 1; }
266279
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
280+
"$HOME/.maestro/bin/maestro" --version
267281
268282
- name: Run Android e2e
269283
uses: reactivecircus/android-emulator-runner@v2
@@ -500,9 +514,23 @@ jobs:
500514
deriveddata-${{ runner.os }}-
501515
502516
- name: Install Maestro
517+
# Use pipefail + verify the binary so a curl flake (e.g. TLS reset
518+
# against github.com:443) doesn't leave us with an "installed" but
519+
# missing maestro binary, which downstream xargs invocations only
520+
# surface as a cryptic exit-code-127 after the build.
503521
run: |
504-
curl -Ls "https://get.maestro.mobile.dev" | bash
522+
set -o pipefail
523+
installed=0
524+
for i in 1 2 3; do
525+
if curl -fLs --retry 3 --retry-delay 5 "https://get.maestro.mobile.dev" | bash; then
526+
if [ -x "$HOME/.maestro/bin/maestro" ]; then installed=1; break; fi
527+
fi
528+
echo "Maestro install attempt $i failed (or binary missing); retrying"
529+
sleep 5
530+
done
531+
[ "$installed" = 1 ] || { echo "::error::Maestro install failed after 3 attempts"; exit 1; }
505532
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
533+
"$HOME/.maestro/bin/maestro" --version
506534
507535
- name: Build and run iOS e2e
508536
env:

0 commit comments

Comments
 (0)