From b418bbd6222968dc3414c346a65c7f530af1c4fc Mon Sep 17 00:00:00 2001 From: spawn-qa-bot Date: Tue, 31 Mar 2026 09:11:02 +0000 Subject: [PATCH] fix(e2e): use jq to count DigitalOcean droplets instead of grep The previous grep -o '"id":[0-9]*' pattern matched all numeric id fields in the droplets JSON response (including nested image/region/size ids), overcounting droplets by 2x and falsely reporting quota exhaustion. Replace with jq '.droplets | length' which correctly counts only top-level droplet objects. This restores DigitalOcean capacity detection so e2e runs can use available droplet slots. -- qa/e2e-tester --- sh/e2e/lib/clouds/digitalocean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/e2e/lib/clouds/digitalocean.sh b/sh/e2e/lib/clouds/digitalocean.sh index 3ffc99cf5..abb0f7462 100644 --- a/sh/e2e/lib/clouds/digitalocean.sh +++ b/sh/e2e/lib/clouds/digitalocean.sh @@ -381,7 +381,7 @@ _digitalocean_max_parallel() { local _account_json _limit _existing _available _account_json=$(_do_curl_auth -sf "${_DO_API}/account" 2>/dev/null) || { printf '3'; return 0; } _limit=$(printf '%s' "${_account_json}" | grep -o '"droplet_limit":[0-9]*' | grep -o '[0-9]*$') || { printf '3'; return 0; } - _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; } + _existing=$(_do_curl_auth -sf "${_DO_API}/droplets?per_page=200" 2>/dev/null | jq -r '.droplets | length' 2>/dev/null) || { 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)" >&2