Test that idle host semaphores and .meta files are removed
check / check (push) Failing after 5m16s

New tests, failing before the fix: fetches from many hosts, and fetches
that end without a connection, must leave no semaphore in hostSems once
they finish; VariantStorage.Delete must remove the variant's .meta file,
and must succeed when that file is already missing.

Model: opus-5-5
This commit is contained in:
2026-10-04 02:27:41 +00:00
parent b402eaf88c
commit 04d3dc91bb
3 changed files with 157 additions and 0 deletions
@@ -194,6 +194,14 @@ func semLen(f *HTTPFetcher, host string) int {
return len(f.getHostSemaphore(host))
}
// hostSemCount reports how many hosts have a semaphore in hostSems.
func hostSemCount(f *HTTPFetcher) int {
f.hostSemMu.Lock()
defer f.hostSemMu.Unlock()
return len(f.hostSems)
}
func TestFetchRedirectToPrivateIPBlocked(t *testing.T) {
t.Parallel()