Test that idle host semaphores and .meta files are removed
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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user