Fix apt concurrency failures
[releng/builder.git] / jjb / packaging / include-raw-test-deb.sh
index 22930fa1713f7b2506a36a7c66ff7c3d50bfc8cc..bc6963adabf89c40d656d73428ba88483f62d5ed 100644 (file)
@@ -6,6 +6,11 @@
 #   -o pipefail: Fail on errors in scripts this calls, give stacktrace
 set -ex -o pipefail
 
+# Wait for any background apt processes to finish
+# There seems to be a backgroud apt process that locks /var/lib/dpkg/lock
+# and causes our apt commands to fail.
+while pgrep apt > /dev/null; do sleep 1; done
+
 # Install ODL from .deb link or .repo url
 if [[ $URL == *.deb ]]
 then