diff --git a/.github/scripts/install-ubuntu-apt-packages.sh b/.github/scripts/install-ubuntu-apt-packages.sh index a93614fbde2..41d2ddab9e8 100644 --- a/.github/scripts/install-ubuntu-apt-packages.sh +++ b/.github/scripts/install-ubuntu-apt-packages.sh @@ -9,7 +9,8 @@ fi bash "$(dirname "${BASH_SOURCE[0]}")/prepare-ubuntu-apt.sh" # Eight minutes of command allowances leave room for tests within the job deadline. -if timeout 45 sudo apt-get update -o Acquire::Languages=none && timeout 120 sudo apt-get install -y "$@"; then +# Run deadlines as root so sudo cannot leave apt in a separate session. +if sudo timeout --kill-after=10s 45 apt-get update -o Acquire::Languages=none && sudo timeout --kill-after=10s 120 apt-get install -y "$@"; then exit 0 fi @@ -21,7 +22,7 @@ done bash "$(dirname "${BASH_SOURCE[0]}")/use-ubuntu-apt-mirror.sh" bash "$(dirname "${BASH_SOURCE[0]}")/recover-ubuntu-dpkg.sh" || true # Unrelated repositories may fail refresh; apt still verifies the requested packages. -if ! timeout 120 sudo apt-get update -o Acquire::Languages=none; then +if ! sudo timeout --kill-after=10s 120 apt-get update -o Acquire::Languages=none; then echo 'Index refresh incomplete; attempting the requested packages with available authenticated indexes.' >&2 fi -timeout 150 sudo apt-get install -y "$@" +sudo timeout --kill-after=10s 150 apt-get install -y "$@" diff --git a/.github/scripts/recover-ubuntu-dpkg.sh b/.github/scripts/recover-ubuntu-dpkg.sh index 3e693de2554..e57a094aa76 100644 --- a/.github/scripts/recover-ubuntu-dpkg.sh +++ b/.github/scripts/recover-ubuntu-dpkg.sh @@ -2,7 +2,7 @@ set -euo pipefail # A timed-out apt frontend can leave dpkg running in a separate session. -timeout 30 sudo bash -euo pipefail -c ' +sudo timeout --kill-after=10s 30 bash -euo pipefail -c ' while lslocks --noheadings --raw --notruncate --output PATH | grep -E "^/var/lib/dpkg/lock(-frontend)?$" >/dev/null; do sleep 1 done diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6cf4c1669e0..bff3558b82c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -932,14 +932,14 @@ jobs: pnpm exec playwright-core install --with-deps webkit exit 0 fi - echo 'Installing WebKit and its dependencies through the primary route.' - if timeout --kill-after=10s 240 pnpm exec playwright-core install --with-deps webkit; then - exit 0 + echo 'Installing WebKit dependencies through the primary route.' + if ! sudo env "PATH=$PATH" timeout --kill-after=10s 240 pnpm exec playwright-core install-deps webkit; then + echo 'Dependency installation did not complete; retrying with the Ubuntu mirror fallback.' + bash .github/scripts/use-ubuntu-apt-mirror.sh + bash .github/scripts/recover-ubuntu-dpkg.sh || true + sudo env "PATH=$PATH" timeout --kill-after=10s 360 pnpm exec playwright-core install-deps webkit fi - echo 'WebKit installation did not complete; retrying with the Ubuntu mirror fallback.' - bash .github/scripts/use-ubuntu-apt-mirror.sh - bash .github/scripts/recover-ubuntu-dpkg.sh || true - timeout --kill-after=10s 360 pnpm exec playwright-core install --with-deps webkit + timeout --kill-after=10s 180 pnpm exec playwright-core install webkit # The entry lives in mobile/ so one React resolves; without this every RN import is nothing. - uses: ./.github/actions/install-mobile-dependencies