Skip to content

Commit 3aba1a7

Browse files
authored
Fix: CI for Ubuntu was failing too often because of apt/dpkg locks (#380)
Problem: the CI is looking for only one lock file, but apt/dpkg use several. Furthermore, `lslocks --json` seems to cut its output to a specific width, and configuration options (`--notruncate`) do not appear to have an impact. Solution: repeat calls to apt-get update until we get the lock. This is not perfect but increases the rate of success.
1 parent 0c2c795 commit 3aba1a7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.github/workflows/test-on-droplet-ubuntu-22.04.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
doctl compute droplet create \
3535
--image ubuntu-22-04-x64 \
36-
--size c-2 \
36+
--size c-4 \
3737
--region fra1 \
3838
--vpc-uuid 992896c8-c089-4da3-9288-f81e28c095a4 \
3939
--enable-ipv6 \
@@ -55,11 +55,9 @@ jobs:
5555
export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci-ubuntu-22-04 --output json | ./.github/scripts/extract_droplet_ipv4.py)"
5656
ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts
5757
58-
# Ubuntu droplets run upgrades at boot
58+
# Ubuntu droplets run upgrades at boot, which locks apt-get
5959
sleep 30
60-
until ! ssh root@${DROPLET_IPV4} "lslocks --json | grep /var/lib/dpkg/lock" > /dev/null; do sleep 1; echo "Waiting for dpkg lock..."; done
61-
62-
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get update"
60+
until ! ssh root@${DROPLET_IPV4} "apt-get update" > /dev/null; do sleep 1; echo "Waiting for apt/dpkg lock..."; done
6361
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get upgrade -y"
6462
ssh root@${DROPLET_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get install -y docker.io apparmor-profiles"
6563
ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha"

0 commit comments

Comments
 (0)