server/internal/client/ollama: handle some network errors gracefully (#10317)

This commit is contained in:
Blake Mizerany
2025-04-17 12:43:09 -07:00
committed by GitHub
parent 09bb2e30f6
commit 1d99451ad7
4 changed files with 115 additions and 16 deletions

View File

@@ -605,8 +605,8 @@ func checkRequest(t *testing.T, req *http.Request, method, path string) {
}
}
func newRegistryClient(t *testing.T, h http.HandlerFunc) (*Registry, context.Context) {
s := httptest.NewServer(h)
func newRegistryClient(t *testing.T, upstream http.HandlerFunc) (*Registry, context.Context) {
s := httptest.NewServer(upstream)
t.Cleanup(s.Close)
cache, err := blob.Open(t.TempDir())
if err != nil {