From 41f9448d786ccca6af1e95f27485e3a09322644e Mon Sep 17 00:00:00 2001 From: Julien Balestra Date: Thu, 14 Jun 2018 13:07:30 +0200 Subject: [PATCH] e2e: fix the pupernetes wait race (#1833) --- .../scripts/run-instance/10-pupernetes-wait.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/e2e/scripts/run-instance/10-pupernetes-wait.sh b/test/e2e/scripts/run-instance/10-pupernetes-wait.sh index c4f9280cf97c3..25705ce216e44 100755 --- a/test/e2e/scripts/run-instance/10-pupernetes-wait.sh +++ b/test/e2e/scripts/run-instance/10-pupernetes-wait.sh @@ -21,5 +21,16 @@ _wait_binary() { _wait_binary pupernetes -set -ex -sudo -kE pupernetes wait --unit-to-watch pupernetes.service --logging-since 2h --timeout 20m +# Binary is here, so setup-pupernetes has completed +# pupernetes.service should start soon because it contains the constraint After=setup-pupernetes.service + +set -x +sudo -kE pupernetes wait --unit-to-watch pupernetes.service --logging-since 2h --timeout 20m || { + # Here pupernetes.service may not be started yet and be considered as dead by go-systemd + # A single retry is enough + # https://github.com/DataDog/pupernetes/issues/46 + sleep 10 + sudo -kE pupernetes wait --unit-to-watch pupernetes.service --logging-since 2h --timeout 20m +} + +exit $?