File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# The dependency dry run uses the pinned driver's package list without updating apt.
33set -euo pipefail
44
5+ # A healthy apt install takes under a minute. A stalled mirror download otherwise holds the
6+ # install, and with it the whole suite step's budget, with no output: apt's inactivity timeout
7+ # misses a download that trickles. Each retry resumes apt's partial downloads.
8+ DEPS_ATTEMPT_SECONDS=120
9+ DEPS_ATTEMPTS=3
10+
511browsers=()
612for argument in " $@ " ; do
713 case " $argument " in
@@ -11,6 +17,20 @@ for argument in "$@"; do
1117done
1218
1319if ! bunx --no-install playwright install-deps --dry-run " ${browsers[@]} " ; then
14- bunx --no-install playwright install-deps " ${browsers[@]} "
20+ for attempt in $( seq " $DEPS_ATTEMPTS " ) ; do
21+ if timeout --kill-after=15 " $DEPS_ATTEMPT_SECONDS " \
22+ bunx --no-install playwright install-deps " ${browsers[@]} " ; then
23+ break
24+ fi
25+ if [ " $attempt " -eq " $DEPS_ATTEMPTS " ]; then
26+ echo " ::error::Browser system packages did not install in $DEPS_ATTEMPTS attempts." >&2
27+ exit 1
28+ fi
29+ echo " Browser system package install attempt $attempt failed or stalled; retrying." >&2
30+ # An attempt cut off while dpkg was unpacking leaves it interrupted, which blocks the retry.
31+ if ! timeout --kill-after=15 " $DEPS_ATTEMPT_SECONDS " sudo dpkg --configure -a; then
32+ echo " Browser system package recovery failed or stalled; retrying anyway." >&2
33+ fi
34+ done
1535fi
1636exec bunx --no-install playwright install " $@ "
You can’t perform that action at this time.
0 commit comments