fix(e2e): redirect DO max_parallel log_warn to stderr (#3110)

_digitalocean_max_parallel() called log_warn which writes colored output
to stdout, polluting the captured return value when invoked via
cloud_max=$(cloud_max_parallel). The downstream integer comparison
[ "${effective_parallel}" -gt "${cloud_max}" ] then fails with
'integer expression expected', silently leaving the droplet limit cap
unapplied. Fix: redirect log_warn output to stderr so only the numeric
value is captured.

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: L <6723574+louisgv@users.noreply.github.com>
This commit is contained in:
A 2026-03-30 21:32:51 -07:00 committed by GitHub
parent 54fc5f3ff3
commit 455f4cd43e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,7 +384,7 @@ _digitalocean_max_parallel() {
_existing=$(_do_curl_auth -sf "${_DO_API}/droplets?per_page=200" 2>/dev/null | grep -o '"id":[0-9]*' | wc -l | tr -d ' ') || { printf '3'; return 0; }
_available=$(( _limit - _existing ))
if [ "${_available}" -lt 1 ]; then
log_warn "DigitalOcean droplet limit reached: ${_existing}/${_limit} droplets in use (0 available)"
log_warn "DigitalOcean droplet limit reached: ${_existing}/${_limit} droplets in use (0 available)" >&2
printf '0'
else
printf '%d' "${_available}"