From 07e010a896ad12d17c8f599b9169c36309d2b5a2 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Sun, 1 Mar 2020 19:38:10 +0100 Subject: [PATCH] Remove race condition in sync e2e test This was found out while testing the GitOps Engine integration --- test/e2e/12_sync.bats | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/e2e/12_sync.bats b/test/e2e/12_sync.bats index 9a3d8f856..e368f4cc5 100644 --- a/test/e2e/12_sync.bats +++ b/test/e2e/12_sync.bats @@ -50,12 +50,10 @@ function setup() { poll_until_true 'workload podinfo' 'kubectl -n demo describe deployment/podinfo' # Check the sync tag - git pull -f --tags - local sync_tag_hash - sync_tag_hash=$(git rev-list -n 1 flux) local head_hash head_hash=$(git rev-list -n 1 HEAD) - [ "$head_hash" = "$sync_tag_hash" ] + poll_until_equals "sync tag" "$head_hash" 'git pull -f --tags > /dev/null 2>&1; git rev-list -n 1 flux' + podinfo_image=$(kubectl get pod -n demo -l app=podinfo -o"jsonpath={['items'][0]['spec']['containers'][0]['image']}") # Bump the image of podinfo, duplicate the resource definition (to cause a sync failure)