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

Function TestRecentErrorRingNilSafe

server/recent_errors_test.go:31–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestRecentErrorRingNilSafe(t *testing.T) {
32 var r *recentErrorRing
33 r.add(RecentError{}) // must not panic
34 if got := r.snapshot(10); got != nil {
35 t.Fatalf("nil ring snapshot = %v, want nil", got)
36 }
37 var s *Server
38 s.recordRecentError(RecentError{}) // nil server must not panic
39 if got := s.RecentErrors(10); got != nil {
40 t.Fatalf("nil server RecentErrors = %v, want nil", got)
41 }
42}
43
44// The load-bearing invariant: a failed CREATE SECRET must NOT leak its credential
45// into the Errors-page ring — neither via the stored query nor the error message

Callers

nothing calls this directly

Calls 4

addMethod · 0.95
snapshotMethod · 0.95
recordRecentErrorMethod · 0.95
RecentErrorsMethod · 0.95

Tested by

no test coverage detected