Fix apt concurrency failures 81/56281/1
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 28 Apr 2017 18:49:54 +0000 (14:49 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 28 Apr 2017 19:18:22 +0000 (15:18 -0400)
Wait until background apt process finishes before trying to install
anything and failing to get /var/lib/dpkg/lock lock.

https://lists.opendaylight.org/pipermail/integration-dev/2017-April/009485.html

Fixes both test-deb and test-ansible-deb jobs.

Change-Id: I5927b0f52d54cd7fd4332a43af5f630c12564ca5
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
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