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

Function newTestProxy

cmd/cache-proxy/proxy_test.go:89–95  ·  view source on GitHub ↗

newTestProxy wires a CacheProxy with no peers and a tempdir-backed store.

(t *testing.T)

Source from the content-addressed store, hash-verified

87 prev := slog.Default()
88 buf := &syncBuffer{}
89 slog.SetDefault(slog.New(slog.NewTextHandler(buf, &slog.HandlerOptions{Level: slog.LevelDebug})))
90 return buf, func() { slog.SetDefault(prev) }
91}
92
93// syncBuffer serializes slog-handler Write calls from proxy goroutines
94// against String reads from the test goroutine.
95type syncBuffer struct {
96 mu sync.Mutex
97 buf bytes.Buffer
98}

Calls 2

NewCacheProxyFunction · 0.85
newTestCacheFunction · 0.85

Tested by

no test coverage detected