chore: Add worker check to bats tests to avoid flake (#6421)
This commit is contained in:
1 parent
f01cd7019b
commit
cb8f0fe188
1 file changed
+17
@@ -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
|
||||
Reference in new issue
Block a user