Fix apt concurrency failures
[releng/builder.git] / jjb / packaging / include-raw-test-ansible-deb.sh
index f77e7806ab154a15bf22f0c7cd5dcf96a8f947fa..31c0dcfc64387241edc0db811a9b63dcc4ddcba5 100644 (file)
@@ -11,6 +11,11 @@ virtualenv deb_build
 source deb_build/bin/activate
 pip install --upgrade pip
 
+# 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 latest ansible
 sudo apt-add-repository ppa:ansible/ansible
 sudo apt-get update