Files
Yunus Emre Karaman daf82a50f0 prober: deflake TestHTTPBandwidth on coarse-clock machines
The test asserts that a successful probe records a positive transfer
time, but the transfer is shorter than one clock tick on the Windows CI
runner: four attempts at 1 MiB plus their connection setups took 2.3ms
in total, yet every measurement read exactly 0, so the retry loop added
in #20214 just re-measured zero and then failed with
"http_bw_transfer_time_seconds_total = 0 after 4 attempts".

A 1 MiB loopback transfer takes ~0.4ms here, so no payload small enough
for a unit test is reliably measurable against a millisecond-coarse
clock. Make the transfer span more than one tick instead: /download now
writes half the payload, flushes, sleeps 50ms, then writes the rest.
The probe measures ~52ms, so the >0 assertion holds deterministically
and the retry loop can be deleted.

Fixes #21620

Signed-off-by: Yunus Emre Karaman <[email protected]>
2026-11-15 07:58:54 -08:00
..