Skip to content

Commit 2db542d

Browse files
committed
bash: common: add timeouts for (host) apt operations
- sometimes GHA runners are a bit inconvenienced by network issues, and hang forever on this - let `apt update` fail, `apt install ..` not Signed-off-by: Ricardo Pardini <[email protected]>
1 parent e2862f8 commit 2db542d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bash/common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ function install_dependencies() {
100100
# If running on Debian or Ubuntu...
101101
if [[ -f /etc/debian_version ]]; then
102102
log info "Installing apt dependencies: ${debian_pkgs[*]}"
103-
sudo DEBIAN_FRONTEND=noninteractive apt -o "Dpkg::Use-Pty=0" -y update
104-
sudo DEBIAN_FRONTEND=noninteractive apt -o "Dpkg::Use-Pty=0" -y install "${debian_pkgs[@]}"
103+
timeout --verbose 5m sudo DEBIAN_FRONTEND=noninteractive apt -o "Dpkg::Use-Pty=0" -y update || true # sometimes apt update hangs forever; timeout after 5 minutes; don't fail
104+
timeout --verbose 10m sudo DEBIAN_FRONTEND=noninteractive apt -o "Dpkg::Use-Pty=0" -y install "${debian_pkgs[@]}" # sometimes apt install hangs forever; timeout after 10 minutes; fail if this fails
105105
elif [[ "$(uname)" == "Darwin" ]]; then
106106
log info "Skipping Debian deps installation for Darwin..."
107107
else

0 commit comments

Comments
 (0)