monitoring: fix progress bar when estimate is short

Rebalance PROGRESS_TOTAL if done exceeds it (never print 224/205);
raise e2e estimate for ATM ladder INFO volume; final line snaps N/N.
This commit is contained in:
Hernâni Marques 2026-07-17 18:55:08 +02:00
parent c6d8d16b8c
commit 020bf77cc7
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
2 changed files with 40 additions and 8 deletions

View file

@ -221,18 +221,20 @@ if [ "${#PHASES[@]}" -eq 0 ]; then
PHASES=(urls)
fi
# Rough expected check counts for progress % (override: PROGRESS_TOTAL=N)
# Rough expected check counts for progress % (override: PROGRESS_TOTAL=N).
# Prefer slightly high — lib.sh rebalances if still short (never shows done>total).
if [ "${PROGRESS_TOTAL:-0}" = "0" ] || [ -z "${PROGRESS_TOTAL:-}" ]; then
_pt=0
for p in "${PHASES[@]}"; do
case "$p" in
urls) _pt=$((_pt + 70)) ;;
inside) _pt=$((_pt + 25)) ;;
versions) _pt=$((_pt + 20)) ;;
sanity) _pt=$((_pt + 30)) ;;
server) _pt=$((_pt + 15)) ;;
e2e) _pt=$((_pt + 90)) ;;
ladder|goa-ladder) _pt=$((_pt + 80)) ;;
urls) _pt=$((_pt + 85)) ;; # +qr group
inside) _pt=$((_pt + 30)) ;;
versions) _pt=$((_pt + 25)) ;;
sanity) _pt=$((_pt + 35)) ;;
server) _pt=$((_pt + 20)) ;;
# e2e: ATM ladder emits many INFO lines (coins before/after each note)
e2e) _pt=$((_pt + 240)) ;;
ladder|goa-ladder) _pt=$((_pt + 120)) ;;
esac
done
set_progress_total "$_pt"