chore: Add worker check to bats tests to avoid flake (#6421)

pull/6436/head
Michael Li 6 days ago committed by GitHub
parent f01cd7019b
commit cb8f0fe188
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -43,5 +43,22 @@ until boundary scopes list; do
sleep 1
done
c=0
until curl -s http://localhost:9203/health\?worker_info\=1 | jq -e '.worker_process_info.upstream_connection_state == "READY"' > /dev/null; do
echo 'waiting for boundary worker to be up'
((c+=1))
if [[ $c -ge $max ]]; then
die "timeout waiting for boundary worker to get healthy"
fi
sleep 1
done
# Wait a little longer to ensure the worker is fully ready before we start
# running tests. Without this, there were some flaky tests, specifically when
# trying to connect to a target in the alias tests (those are the first to run).
# The worker health check alone was not sufficient during testing, and it was
# not clear what else could be checked to ensure the worker was fully ready.
sleep 10
echo "running bats tests"
bats -p ./boundary

Loading…
Cancel
Save