test(verify): follow redirects and bypass the edge cache

Two ways the harness lied about what it was measuring.

The router answers an index request with a redirect, and fetch() did not
pass -L, so a --live byte comparison compared against a 302 body rather
than the index a client ends up with.

A purge is asynchronous, so a run started right after a reindex read
whatever the edge still held. That produced a phantom '161 regressions'
on amd64/alpine323 whose PACKAGES.rds was already correct - the .gz was
simply a stale copy, and re-measuring after the purge settled showed
zero. A verification tool that races the thing it verifies is worse than
no tool.
This commit is contained in:
Patrick Schratz 2026-08-31 10:26:09 +00:00
commit 2171f8ea3b
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -104,10 +104,12 @@ fetch() {
return 0 return 0
fi fi
local status local status
# -L: the router answers an index request with a redirect, so the bytes a
# client ends up with are only visible by following it.
if [ -n "$ua" ]; then if [ -n "$ua" ]; then
status=$(curl -sS -A "$ua" -o "$dest" -w '%{http_code}' --max-time 120 "$url" 2>/dev/null) status=$(curl -sSL -A "$ua" -o "$dest" -w '%{http_code}' --max-time 120 "$url" 2>/dev/null)
else else
status=$(curl -sS -o "$dest" -w '%{http_code}' --max-time 120 "$url" 2>/dev/null) status=$(curl -sSL -o "$dest" -w '%{http_code}' --max-time 120 "$url" 2>/dev/null)
fi fi
echo "$status" > "$dest.status" echo "$status" > "$dest.status"
echo "$status" echo "$status"