From f9e18bc348a1e499393111834f520cad2dc17c3b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 5 Sep 2018 15:31:36 -0700 Subject: [PATCH] Run puppet apply test serially on centos There appears to be a race running the ansible synchronize (rsync under the hood) top copy puppet modules for multiple puppet applies at the same time on CentOS7. Running this in parallel appears safe on Ubuntu and does save quite a bit of job runtime. Workaround this by running the apply test serially on CentOS only. Change-Id: Icd0836db215c0b417989d38994a378a705bbc62b --- tools/apply-test.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/apply-test.sh b/tools/apply-test.sh index c196f059d1..09cf7562c5 100755 --- a/tools/apply-test.sh +++ b/tools/apply-test.sh @@ -69,8 +69,16 @@ sudo mkdir -p /var/run/puppet echo "Running apply test primer to avoid setup races when run in parallel." ./tools/test_puppet_apply.sh applytest/primer.pp +THREADS=$(nproc) +if grep -qi centos /etc/os-release ; then + # Single thread on centos to workaround a race with rsync on centos + # when copying puppet modules for multiple puppet applies at the same + # time. + THREADS=1 +fi + echo "Running apply test on these hosts:" find applytest -name 'puppetapplytest*.final' -print0 find applytest -name 'puppetapplytest*.final' -print0 | \ - xargs -0 -P $(nproc) -n 1 -I filearg \ + xargs -0 -P $THREADS -n 1 -I filearg \ ./tools/test_puppet_apply.sh filearg