qemu_get_busybox and fetch-kernel-tarball.sh ran curl with no connect
timeout, stall limit or total cap. A server that answered and then went
silent held the flare-edge QEMU UI gate build job until its 30 minute
timeout, with no retry (flare-edge #1588, run 7391 job 63953).
- qemu/lib.sh: each attempt gives up below 1 KiB/s for 20 s, or after
60 s in all; curl retries once, the 3-attempt loop stays. Limits are
overridable through BB_FETCH_* for the tests.
- build/fetch-kernel-tarball.sh: 20 s connect timeout, abort below
10 KiB/s for 30 s, 600 s cap. The download lands in a temp file and is
renamed on success, so a failed fetch no longer leaves a partial
tarball that the next run takes as present and rejects on its sha256.
- Tests: busybox-fetch.sh serves a stalling local HTTP endpoint to the
real curl (hung for the full 60 s guard before, fails in about 9 s
after); new tests/fetch-kernel-tarball suite (bounded argv, no partial
file, refetch after a failure, reuse of a matching tarball; 6 of 9
checks red before). Both wired into CI and shellcheck.
Refs blueflare/flare-edge#1588
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG