Remove race condition in sync e2e test
This was found out while testing the GitOps Engine integration
@@ -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)
