Merge "Fix apt concurrency failures"
authorJamo Luhrsen <jluhrsen@redhat.com>
Fri, 28 Apr 2017 22:32:15 +0000 (22:32 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 28 Apr 2017 22:32:15 +0000 (22:32 +0000)
jjb/packaging/include-raw-test-ansible-deb.sh
jjb/packaging/include-raw-test-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
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