Skip to content

Commit aa50f8d

Browse files
committed
Retry the Snap Store install in CI
Three runs of ubuntu-build in a row failed before any test ran because the Snap Store timed out installing the fixture snap ("context deadline exceeded"). The install now retries five times with a growing pause, as the apt steps already retry slow mirrors.
1 parent 403cdb0 commit aa50f8d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎.github/workflows/build.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,13 @@ jobs:
243243
# snap run --shell applies the snap's real AppArmor profile, seccomp
244244
# filter and mount namespace; its user-data directory is visible inside.
245245
run: |
246-
sudo snap install hello-world
246+
# The Snap Store can time out for minutes at a time: retry the
247+
# install with a growing pause instead of failing the whole job.
248+
for attempt in 1 2 3 4 5; do
249+
sudo snap install hello-world && break
250+
[ "$attempt" = 5 ] && exit 1
251+
sleep $((attempt * 30))
252+
done
247253
data="$HOME/snap/hello-world/current"
248254
mkdir -p "$data" && cp build/static_fixture_musl "$data/"
249255
python3 test/frontend_target_gate.py build "$data/static_fixture_musl" \

0 commit comments

Comments
 (0)