MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestCacheProxyHealthURL

Function TestCacheProxyHealthURL

duckdbservice/cache_proxy_test.go:64–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62 })
63}
64
65func TestCacheProxyConnectTimeout(t *testing.T) {
66 t.Run("default is documented and bounded", func(t *testing.T) {
67 t.Setenv("DUCKGRES_CACHE_PROXY_CONNECT_TIMEOUT", "")
68 if got := cacheProxyConnectTimeout(); got != 5*time.Second {
69 t.Fatalf("default timeout = %s, want 5s", got)
70 }
71 })
72 t.Run("uses explicit duration", func(t *testing.T) {
73 t.Setenv("DUCKGRES_CACHE_PROXY_CONNECT_TIMEOUT", "750ms")
74 if got := cacheProxyConnectTimeout(); got != 750*time.Millisecond {
75 t.Fatalf("timeout = %s, want 750ms", got)
76 }
77 })
78 t.Run("invalid value fails safely to default", func(t *testing.T) {
79 t.Setenv("DUCKGRES_CACHE_PROXY_CONNECT_TIMEOUT", "0s")
80 if got := cacheProxyConnectTimeout(); got != defaultCacheProxyConnectTimeout {
81 t.Fatalf("timeout = %s, want default %s", got, defaultCacheProxyConnectTimeout)

Callers

nothing calls this directly

Calls 2

cacheProxyHealthURLFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected