ci(deploy): retry the :22 smoke test for up to ~2 minutes (#137)
Some checks are pending
CI / build (push) Waiting to run
deploy / deploy (push) Waiting to run
test / test (push) Waiting to run

The redeploy restarts agentbbs, and the smoke test could run before it had
re-bound :22 (0.3 s after on the #136 deploy). One probe made most deploys go
red while the BBS answered moments later. Probe up to 12 times, 10 s apart,
and fail only if :22 never answers. Still a keyscan only, so no account is
ever registered.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-10-01 03:51:27 -07:00 • committed by GitHub
parent f5c8e31d26
commit eccfe67bc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,9 +162,18 @@ jobs:
# join@ connection would register the connecting key as a new account, # join@ connection would register the connecting key as a new account,
# so we never complete a handshake here. Admin OpenSSH lives on the # so we never complete a handshake here. Admin OpenSSH lives on the
# admin port, so anything serving :22 is agentbbs answering join@/bbs@. # admin port, so anything serving :22 is agentbbs answering join@/bbs@.
if timeout 15 ssh-keyscan -T 10 -p 22 "$DEPLOY_HOST" 2>/dev/null | grep -q .; then #
echo "::notice::agentbbs is serving SSH on ${DEPLOY_HOST}:22 (join@ is reachable)" # Retry: the redeploy above restarts agentbbs, and this step can start
else # before it has re-bound :22. A single probe failed most deploys
echo "::error::nothing is serving SSH on ${DEPLOY_HOST}:22 — agentbbs may be down" # (red runs with the BBS answering fine moments later), so give it
exit 1 # up to ~2 minutes and fail only if it never comes back.
fi for attempt in $(seq 1 12); do
if timeout 15 ssh-keyscan -T 10 -p 22 "$DEPLOY_HOST" 2>/dev/null | grep -q .; then
echo "::notice::agentbbs is serving SSH on ${DEPLOY_HOST}:22 (join@ is reachable, attempt ${attempt})"
exit 0
fi
echo "attempt ${attempt}/12: nothing on ${DEPLOY_HOST}:22 yet, retrying in 10s"
sleep 10
done
echo "::error::nothing is serving SSH on ${DEPLOY_HOST}:22 after 12 attempts — agentbbs may be down"
exit 1