MCPcopy
hub / github.com/redis/go-redis / startMockRESP2Server

Function startMockRESP2Server

internal_maint_notif_test.go:194–211  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func startMockRESP2Server(t *testing.T) *mockRESP2Server {
195 t.Helper()
196 ln, err := net.Listen("tcp", "127.0.0.1:0")
197 if err != nil {
198 t.Fatalf("failed to listen: %v", err)
199 }
200 s := &mockRESP2Server{ln: ln}
201 go func() {
202 for {
203 conn, err := ln.Accept()
204 if err != nil {
205 return
206 }
207 go s.handle(conn)
208 }
209 }()
210 return s
211}
212
213// assertNoMaintNotifications fails the test if a CLIENT MAINT_NOTIFICATIONS
214// command was observed by srv.

Calls 1

handleMethod · 0.95

Tested by

no test coverage detected